SKILL data type

Guest
Hi,

I need to read data from a file. I do it with

line=read(fp)
name=car(parseString(line " "))
It parses all other data but when it gets to "ctrl<63>" it issues an
error that the expected data is not of type SS.
Does anyone knows what type is "ctrl<63>" read form a text file?

Thanks,
Sonia
 
On Aug 24, 10:08 pm, s_kouchl...@yahoo.com wrote:
Hi,

I need to read data from a file. I do it with

line=read(fp)
name=car(parseString(line " "))
It parses all other data but when it gets to "ctrl<63>" it issues an
error that the expected data is not of type SS.
Does anyone knows what type is "ctrl<63>" read form a text file?

Thanks,
Sonia
Hi,
It's hard to say something definite without seeing data you're
parsing.
But I can only suppose that 'parseString' is fed with something
different from symbol or string.
For example it can be function definition (list) or something.
Yoy can add a pair of "debug" lines to your code, like these:
println(line)
println(type(line))
And see what you feed parseString with.
Hope it will help to clarify your problem a little bit.
 
I need to read data from a file. I do it with

line=read(fp)
name=car(parseString(line " "))
It parses all other data but when it gets to "ctrl<63>" it issues an
error that the expected data is not of type SS.
Does anyone knows what type is "ctrl<63>" read form a text file?
read attempts to parse the input line into a SKILL list. Any bareword in the inputfile will return a
symbol, and if the word is quoted, it will return a string. But it will parse also SKILL expressions.

In your case, ctrl<63> is interpreted as it should, that is, as a the SKILL syntax for accessing bit
63 of variable ctrl. What you get is the equivalent function call : (bitfield1 ctrl 63). It's a
list, not a string or symbol as parseString expects, therefore the error.


Anyway... read is not the function you want to use unless you really want to read SKILL code. You
should rather use gets(), for example. It will always return a string.



Stéphane
 

Welcome to EDABoard.com

Sponsor

Back
Top