Re: command_line() - convert a sequence to an atom value?

new topic     » goto parent     » topic index » view thread      » older message » newer message

CK presents one method or you can use something like this
which is ultra fast,

address = allocate(256) -- 'warning' only 256 bytes can be used
mem_set(address, 0, 256)

poke your value staring at 'address' location
and then you can peek the value from 'address' later
when its needed again.

be sure to free the allocated space when your finished with
the data contained in 'address' useing free(address)

if you have some code, I could help you modify it some to work like this.

Euman
euman at bellsouth.net

> I want to convert my program from prompting for user input to including this
> input on the command line.  I have used the command_line() function to do
> so, but have come across a small problem.
> 
> If my program prompts the user for the data from within the program:
> Enter the data :
> 30
> then then value 30 can be stored as an atom as declared.
> 
> But command_line() returns a sequence with the value {51,48} which cannot be
> stored in my nice little atom.
> 
> So, I am looking at reworking my code to treat everything as a sequence, but
> it would be a whole lot nicer if there happens to be a way of storing the
> numerical value of the command_line() sequence {51,48} as 30 in my atom.
> 
> Any ideas?
> 
> Joel Garcia

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu