TYPE and END TYPE command

Here one can report bugs or hold discussions about bugs updates and work arounds.
Post Reply
Fcfernandez
Posts: 2
Joined: Fri Aug 05, 2011 11:44 am

TYPE and END TYPE command

Post: # 816Post Fcfernandez
Mon Jan 16, 2012 4:15 pm

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  :)

Marco
Site Admin
Posts: 246
Joined: Sat Sep 15, 2018 8:41 pm

TYPE and END TYPE command

Post: # 817Post Marco
Mon Jan 16, 2012 4:33 pm

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

PaPi
Posts: 114
Joined: Wed May 16, 2007 11:55 am

TYPE and END TYPE command

Post: # 818Post PaPi
Mon Jan 16, 2012 4:37 pm

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

Fcfernandez
Posts: 2
Joined: Fri Aug 05, 2011 11:44 am

TYPE and END TYPE command

Post: # 819Post Fcfernandez
Tue Jan 17, 2012 7:20 pm

Thanks for your help.

Post Reply