1. can't figure this out

Here's the code...

 printf(1,"%d  %d\n",{screenTable[i][8],screenTable[i][7]})        -- this
prints a 9 and a 2  so table8 is 9 and table7 is 2

   tmp =
ntf("%d",screenTable[i][8])&"."&sprintf("%d",screenTable[i][7])     -- if i
print this with a printf i get 57.00 ???????

why is tmp not 9.2 ??


...george

new topic     » topic index » view message » categorize

2. Re: can't figure this out

Bernie, i is the same. The 2 statements are next to each other. No code in
between.

...george

----- Original Message -----
From: "Bernie Ryan" <xotron at localnet.com>
To: "EUforum" <EUforum at topica.com>
Subject: RE: can't figure this out


>
>
> George Walters wrote:
> > Here's the code...
> >
> >  printf(1,"%d  %d\n",{screenTable[i][8],screenTable[i][7]})        --
> >  this
> > prints a 9 and a 2  so table8 is 9 and table7 is 2
> >
> >    tmp =
> > ntf("%d",screenTable[i][8])&"."&sprintf("%d",screenTable[i][7])     --
> > if i
> > print this with a printf i get 57.00 ???????
> >
> > why is tmp not 9.2 ??
> >
> >
> george:
>
>   Are you sure that the value [i] is the same? Try printing it
>   out at the same point in your program loop
> Bernie
>
>
>

new topic     » goto parent     » topic index » view message » categorize

3. Re: can't figure this out

-------Phoenix-Boundary-07081998-

new topic     » goto parent     » topic index » view message » categorize

4. Re: can't figure this out

Bernie... run this

sequence screenTable, tmp

screenTable = {0,0,0,0,0,0,2,8}


printf(1,"%d  %d\n",{screenTable[8],screenTable[7]})
tmp = sprintf("%d",screenTable[8])&"."&sprintf("%d",screenTable[7])
printf(1,"%4.2f\n",tmp)

tmp = gets(0)
 
 

...george
----- Original Message ----- 
From: "Bernie Ryan" <xotron at localnet.com>
To: "EUforum" <EUforum at topica.com>
Sent: Tuesday, August 28, 2001 6:33 PM
Subject: RE: can't figure this out


> 
> 
> George Walters wrote:
> > Here's the code...
> > 
> >  printf(1,"%d  %d\n",{screenTable[i][8],screenTable[i][7]})        -- 
> >  this
> > prints a 9 and a 2  so table8 is 9 and table7 is 2
> > 
> >    tmp =
> > ntf("%d",screenTable[i][8])&"."&sprintf("%d",screenTable[i][7])     -- 
> > if i
> > print this with a printf i get 57.00 ???????
> > 
> > why is tmp not 9.2 ??
> > 
> > 
> george:
> 
>   Are you sure that the value [i] is the same? Try printing it
>   out at the same point in your program loop
> Bernie
> 
> 
>

new topic     » goto parent     » topic index » view message » categorize

5. Re: can't figure this out

Hi George,

printf(1,"%d  %d\n",{screenTable[i][8],screenTable[i][7]})  -- this prints a
9 and a 2  so table8 is 9 and table7 is 2

-- This works
tmp=sprintf("%d",screenTable[i][8]&"."&screenTable[i][7]) -- tmp will be the
numeric value of 9.2

-- This doesn't work
--tmp=sprintf("%d",screenTable[i][8])&"."&sprintf("%d",screenTable[i][7]) --
tmp will be a sequence value of{57'9',46'.',50'2'}

> why is tmp not 9.2 ??
It's not 9.2 because you are concatenating the value of Table[i][8] and "."
and Table[i][7], which equals {57'9',46'.',50'2'}

Chris

new topic     » goto parent     » topic index » view message » categorize

6. Re: can't figure this out

Thanks for all the comments. I don't know why I couldn't see the problem.
It's important to use the correct mask's! Nice to have all this help out
there. When you're writing a pgm you tend to see what you are trying to do
not what you are actually doing..

...george

----- Original Message -----
From: "George Walters" <gwalters at sc.rr.com>
To: "EUforum" <EUforum at topica.com>
Subject: Re: can't figure this out


>
> Bernie... run this
>
> sequence screenTable, tmp
>
> screenTable = {0,0,0,0,0,0,2,8}
>
>
> printf(1,"%d  %d\n",{screenTable[8],screenTable[7]})
> tmp = sprintf("%d",screenTable[8])&"."&sprintf("%d",screenTable[7])
> printf(1,"%4.2f\n",tmp)
>
> tmp = gets(0)
>
>
> ...george
> ----- Original Message -----
> From: "Bernie Ryan" <xotron at localnet.com>
> To: "EUforum" <EUforum at topica.com>
> Sent: Tuesday, August 28, 2001 6:33 PM
> Subject: RE: can't figure this out
>
>
> > George Walters wrote:
> > > Here's the code...
> > >
> > >  printf(1,"%d  %d\n",{screenTable[i][8],screenTable[i][7]})        --
> > >  this
> > > prints a 9 and a 2  so table8 is 9 and table7 is 2
> > >
> > >    tmp =
> > > ntf("%d",screenTable[i][8])&"."&sprintf("%d",screenTable[i][7])     --
> > > if i
> > > print this with a printf i get 57.00 ???????
> > >
> > > why is tmp not 9.2 ??
> > >
> > >
> > george:
> >
> >   Are you sure that the value [i] is the same? Try printing it
> >   out at the same point in your program loop
> > Bernie
> >
> >
>
>

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu