1. RE: setText and integers

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.
> 
>

new topic     » topic index » view message » categorize

2. RE: setText and integers

This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_000_01C23816.14084F00
 charset=iso-8859-1

I note the reposnse of others. I can add that win32lib has sprintf
"built-in". For example:

   setText(StatBar, {"The value of x =",x})

should work fine.

------------
Derek.

> -----Original Message-----
> From: Mark Moran [mailto:mdmoran at kpmg.ca]
> Sent: Wednesday, 31 July 2002 2:36
> To: EUforum
> Subject: setText and integers
> 
> 
> 
> 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.
> 
> 
> 
> 

==================================================================
De informatie opgenomen in dit bericht kan vertrouwelijk zijn en 
is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht 
onterecht ontvangt wordt u verzocht de inhoud niet te gebruiken en 
de afzender direct te informeren door het bericht te retourneren. 
==================================================================
The information contained in this message may be confidential 
and is intended to be exclusively for the addressee. Should you 
receive this message unintentionally, please do not use the contents 
herein and notify the sender immediately by return e-mail.


==================================================================

------_=_NextPart_000_01C23816.14084F00
Content-Type: application/ms-tnef

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

Search



Quick Links

User menu

Not signed in.

Misc Menu