1. RE: setText and integers - further clarification requested
- Posted by Mark Moran <mdmoran at kpmg.ca> Jul 30, 2002
- 370 views
WooHoo! (ahem, sorry :) Awesome, I believe that's exactly what I need. Thanks Jonas! Can I also then use sprintf() to put transfer an integer value to a sequence? For example: integer x sequence y x = 1234 y = sprintf( "%d" , x ) -- will "y" now be {"1234"} ? Thanks for the help Jonas! Mark. Jonas Temple wrote: > Mark, > > First of all, welcome to the community! > > What I think you're looking for is sprintf, which formats an integer > into a sequence of characters. The syntax is the same as printf but > does not output to the console. For example: > > setText(MyTextEdit, sprintf("%d", some_number)) > > HTH, > > Jonas > Mark Moran wrote: > > Hiya folks > > > > I'm quite new to Euphoria (and am lovin' it more and more every day), > > and am having a bit of a challenge with something. > > > > As part of my monitoring/debugging process with an Internet > > client/server set of programs that I'm developing, I want to see key > > variables at selected points in the execution. > > > > It's a win32 program (using win32lib and eulibnet includes). > > > > So here's my challenge. When I try to show the values of integer > > variables with setText(), they usually show non-printable characters. > > This is leading me to believe that setText is meant to only be used with > > > > > > sequences, and that integers will be shown as their ascii equivalents, > > which isn't what I want. > > > > For example, > > -- where x=1 > > setText ( StatusBar , "The value of x =" &x ) > > -- in the StatusBar, a block (which I'm guessing is ascii(1)) shows > > after the "=" sign. > > > > To get around this, I've been using 'printf', but I don't want these in > > a separate console window. Plus I'll be showing some key variables to > > users during execution as well (such as number of connected clients, > > etc.), so it'd be nice to know how to use setText with integer variables > > > > > > (and atoms too, I suppose). > > > > Any help for this neophyte? > > > > Thanks folks. > > > > Mark. > > > >
2. RE: setText and integers - further clarification requested
- Posted by jordah ferguson <jorfergie03 at yahoo.com> Jul 30, 2002
- 369 views
Yes you can Mark Happy coding jordah Mark Moran wrote: > WooHoo! (ahem, sorry :) > > Awesome, I believe that's exactly what I need. Thanks Jonas! > > Can I also then use sprintf() to put transfer an integer value to a > sequence? > > For example: > integer x > sequence y > x = 1234 > y = sprintf( "%d" , x ) > > -- will "y" now be {"1234"} ? > > Thanks for the help Jonas! > > Mark. > > > Jonas Temple wrote: > > Mark, > > > > First of all, welcome to the community! > > > > What I think you're looking for is sprintf, which formats an integer > > into a sequence of characters. The syntax is the same as printf but > > does not output to the console. For example: > > > > setText(MyTextEdit, sprintf("%d", some_number)) > > > > HTH, > > > > Jonas > > Mark Moran wrote: > > > Hiya folks > > > > > > I'm quite new to Euphoria (and am lovin' it more and more every day), > > > and am having a bit of a challenge with something. > > > > > > As part of my monitoring/debugging process with an Internet > > > client/server set of programs that I'm developing, I want to see key > > > variables at selected points in the execution. > > > > > > It's a win32 program (using win32lib and eulibnet includes). > > > > > > So here's my challenge. When I try to show the values of integer > > > variables with setText(), they usually show non-printable characters. > > > This is leading me to believe that setText is meant to only be used with > > > > > > > > > sequences, and that integers will be shown as their ascii equivalents, > > > which isn't what I want. > > > > > > For example, > > > -- where x=1 > > > setText ( StatusBar , "The value of x =" &x ) > > > -- in the StatusBar, a block (which I'm guessing is ascii(1)) shows > > > after the "=" sign. > > > > > > To get around this, I've been using 'printf', but I don't want these in > > > a separate console window. Plus I'll be showing some key variables to > > > users during execution as well (such as number of connected clients, > > > etc.), so it'd be nice to know how to use setText with integer variables > > > > > > > > > (and atoms too, I suppose). > > > > > > Any help for this neophyte? > > > > > > Thanks folks. > > > > > > Mark. > > > > > >