Posts: 319
Threads: 68
Joined: Mar 2005
Alright i just started working on making a program that could save and load stuff. But I don't know how to print out and store the directory. kinda like a gui. Could somone tell me?
his world has been connected...
Tied to the darkness.
Soon to be completely eclipsed.
There is so very much to learn...
You understand so little.
A meaningless effort.
One who knows nothing can understand nothing.
-Ansem Bringer of darkness and creator of the heartless
Posts: 525
Threads: 23
Joined: Oct 2004
PyroKid,
You can do something like this to get the list of files:
Code:
DIM FileArray() AS String
DIM Counter AS LONG
DIM WorkFile AS STRING
WorkFile = DIR("*.*") ' CHANGE FILE SPECS IF NEEDED
COUNTER = 0
DO WHILE LEN(WorkFile) <> 0
Counter = Counter + 1
REDIM PRESERVE FileArray(Counter) AS STRING
FileArray(Counter) = WorkFile
WorkFile = DIR
LOOP
Posts: 3,368
Threads: 195
Joined: Jan 2003
Definitely easier with a windows environment DIR.
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."
Visit www.neobasic.net to see rubbish in all its finest.
Posts: 140
Threads: 13
Joined: Apr 2005
FileArray(Counter) = WorkFile
must be
FileArray(Counter-1) = WorkFile
First arrayindex are 0 by default or not?
Joshy
Code:
DO WHILE LEN(WorkFile) <> 0
REDIM PRESERVE FileArray(Counter+1) AS STRING
FileArray(Counter) = WorkFile
Counter+=1
WorkFile = DIR
LOOP
sorry about my english
Posts: 1,845
Threads: 44
Joined: Aug 2002
:
Code:
Option Dynamic
...
DO WHILE LEN(WorkFile) <> 0
REDIM PRESERVE FileArray(Counter) AS STRING
FileArray(Counter) = WorkFile
Counter = Counter + 1
WorkFile = DIR
LOOP
Maybe this works better.
Posts: 140
Threads: 13
Joined: Apr 2005
Hello Neo,
first counter is 0
and
redim preserve array(0) as type
is not the same as
redim preserve array(1) as type
or not ?
what for a fb version you are using and Win or Lin?
Joshy
sorry about my english