Hello,
I wrote short code to read a file(CSV) and then I am storing the vlaues in a respecive variable.
Example:
CSV FILE:
w 1.1
l 0.9
grid 0.35
My code:
while( str = lineread(file)
case( car(str)
(w
if(cdr(str)
then
w = cadr(str)
else error("w not defined in %s file" file)
); end if
);w
(l
if(cdr(str)
then
l = cadr(str)
else error("l not defined in %s file" file)
); end if
);l
and then I will use these values to define the parameters in pcell with same variable
;;FORMAL PARAMETERS
(
(w float w) ;; This is wrong, I want to skip this
(l float w)
)
As the above method is not correct but I have already stored the value in "w" and "l" so how Can I define my formal parameters with the values that I have read from file ?
will this work:
(
(w)
(l)
)
or is there any way I create a database and directly create the object in database variable and store values like
if(cdr(str)
then
myObj~>w = cadr(str)
and then while defining pCell parameters I can write
(
(w float myObj~>w)
(l float myObj~>l)
)
Which method is suitable can anyone guide me ?
Thanks and sorry for the bad explanation.