Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Reading a file into multiple variables
#11
Quote:right i am twelve and don't know what
Quote:psuedo
.

and i need it so that i can make packets for my ftp program

Actually, the word is spelled PSEUDO, which means fictitious. A pseudonym is a fictitious name, like an alias.

Pseudo-code means "not exactly" code. You would write detail specifications of an algorithm, for example, in pseudo-code when you didn't know exactly what language it was going to be written in. Plus the fact that you don't want actual code in the specifications. Pseudo-code in specifications is readily accepted.

Pseudo-code is also often used when either the authors or part of the intended audience are not programmers. It also never suffers from any language-related bugs --- runs like a champ!

Sample pseudo-code:
ADD 1 TO THE TOTAL.
IF THE TOTAL EXCEEDS THE LIMIT GO TO STEP 3.5.
PRINT THE TOTAL ON THE SCREEN.
etc.
*****
Reply
#12
Quote:right i am twelve and don't know what
Quote:psuedo
Pseudo = False, imitating, resembling, insincere.
Pseudocode = Programming code not specifically written in any language. Generally a rough out-line of a program, or algorithm.
url=http://www.spreadfirefox.com/?q=affiliates&id=60131&t=79][Image: safer.gif][/url]
END OF LINE.
Reply
#13
thnx for the help.
url=http://www.spreadfirefox.com/?q=affiliates&id=0&t=79][Image: safer.gif][/url]
Reply
#14
Moneo: it was a spelling mistake, k? Smile

Well then GDM, lets see some of this pseudo code, so we can help you out.
Reply
#15
Quote:Moneo: it was a spelling mistake, k? ...

No it wasn't, it was a keystroke transposition error. :wink:
Reply
#16
right this is what i basically want to do

open filename$ for output as #1
input #1, fileinput$
if fileinput$ > then
then it continues saving here and so on.

no please help me
url=http://www.spreadfirefox.com/?q=affiliates&id=0&t=79][Image: safer.gif][/url]
Reply
#17
You can try this code:

Code:
OPEN filename$ FOR BINARY AS #1
   DIM Array(LOF(1) / 2500) AS STRING
   got& = 0
   flen& = LOF(1)
   buffer$ = SPACE$(2500)
   buffersize = 2500
   index = 0
   DO
      IF got& + buffersize > flen& THEN buffersize = flen& - got&
      buffer$ = SPACE$(buffersize)
      GET #1, , buffer$
      Array(index) = buffer$
      index = index + 1
      got& = got& + buffersize
   LOOP UNTIL got& = flen&
CLOSE #1

This code stores the file into the Array().
Reply
#18
mm thanx. is there any better code than this(no offence neo)
url=http://www.spreadfirefox.com/?q=affiliates&id=0&t=79][Image: safer.gif][/url]
Reply
#19
Quote:mm thanx. is there any better code than this(no offence neo)
I don't think there's a lot that could be done to improve on his code - it's well thought out and does what you asked for.
The question is: are you really sure you want it in a set of 2500 byte blocks?
There might be a better approach, but it depends: What kind of file will it be loading, what will it do with it? etc...
Reply
#20
Quote:...The question is: are you really sure you want it in a set of 2500 byte blocks?
There might be a better approach, but it depends: What kind of file will it be loading, what will it do with it? etc...
GDM:
Sterling and I have the same fundamental questions about the 2500 byte blocks, the kind of input file, and what will you do with it? Share your ideas with us.
*****
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)