Page 1 of 1

TYPE and END TYPE command

Posted: Mon Jan 16, 2012 4:15 pm
by Fcfernandez
I do not speak English. I use google translator to write to you.

I started using FX and searching for QB replacement and other compilers I found and I`m FNX provided.

I can create with "TYPE" variables such as "QBASIC" and then use with DIM

This command was in the previous version of FNX, but not currently. Trying to create a data matrix example:
TYPE DTS
NOMBRE AS STRING * 32
DIRECCION AS STRING * 64
END TYPE

DIM CLIENTES(1 to 55) as DTS

but I can not do it. I do not understand how this works in FNX  :-[
Greetings to all  :)

TYPE and END TYPE command

Posted: Mon Jan 16, 2012 4:33 pm
by Marco
The new version of fnx has no type function yet.
You can use the record function for it.
record car
  s as string *50
  p as integer
end record

to put it into an array:
dim rarray(100) as string
car.s="test"
car.p=10
rarray(2)=p

to read:
p=rarray(2)
print car.p
print car.s

you can also use the randomfile component to read and write records to a file.
best regards

TYPE and END TYPE command

Posted: Mon Jan 16, 2012 4:37 pm
by PaPi
See the answer  for this question on "General Category"!

The URL :  (ONE line!)
http://www.fnxbasic.com/cgi-bin/yabb2/YaBB.pl?num=1326507808

PaPi

TYPE and END TYPE command

Posted: Tue Jan 17, 2012 7:20 pm
by Fcfernandez
Thanks for your help.