home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
basic
/
library
/
pb
/
library1
/
pb091190
< prev
next >
Wrap
Text File
|
1990-09-11
|
8KB
|
259 lines
all
H#: 65035 S12/SPECTRA Publishing
10-Sep-90 20:05:35
Sb: #64142-#Peace and Quiet !
Fm: John Watts 73760,751
To: Bob Zale: PowerBASIC R&D 76304,1303 (X)
Bob,
The following is a sub I wrote to parser the command line. It uses
EXTRACT$ & REMOVE$ so it may help someone who has never used these two
functions to appreciate their power.
' This sub routine parsers the command line ' ' You must dimension an array to
the maximum number of parameters expected ' It returns this array and the
number of active elements
sub parser(CommandLine$(),NumElem%)
NumDim% = NumElem%
NumElem% = 0
C$ = ucase$(command$)
while len(C$) > 0
incr NumElem%
CommandLine$(NumElem%) = extract$(C$," ")
C$ = remove$(C$,CommandLine$(NumElem%)+" ")
if NumElem% = NumDim% then exit sub
wend end sub
Example:
Dim X$(1:6) 'Allow for a maximum of 6 parameters Call Parser(X$,6)
'Now X$(1) thru X$(6) will contain the parameters of the command line
For x% = 1 to 6
print X$(x%) next x% end
PS:
I would like to thank you ( Bob ). With out you the above code would
not be possible. Keep up the good work.
Best wishes
John
There is 1 Reply.
Press <CR> for next or type CHOICES !
H#: 65047 S12/SPECTRA Publishing
10-Sep-90 20:39:44
Sb: #65035-#Peace and Quiet !
Fm: John Watts 73760,751
To: John Watts 73760,751 (X)
Sorry about the garbage. Here's the code again.....( I hope )
' This sub routine parsers the command line ' You must dimension an array to
the maximum number of parameters expected ' It returns this array and the
number of active elements
sub parser(CommandLine$(),NumElem%)
NumDim% = NumElem%
NumElem% = 0
C$ = ucase$(command$)
while len(C$) > 0
incr NumElem%
CommandLine$(NumElem%) = extract$(C$," ")
C$ = remove$(C$,CommandLine$(NumElem%)+" ")
if NumElem% = NumDim% then exit sub
wend end sub
Example:
Dim X$(1:6) 'Allow for a maximum of 6 parameters Call Parser(X$,6)
'Now X$(1) thru X$(6) will contain the parameters of the command line
For x% = 1 to 6
print X$(x%) next x% end
There is 1 Reply.
Press <CR> for next or type CHOICES !
H#: 65050 S12/SPECTRA Publishing
10-Sep-90 20:51:53
Sb: #65047-#Peace and Quiet !
Fm: John Watts 73760,751
To: John Watts 73760,751
Well I tried..........would someone please tell me what went wrong. I'm using
the old TB editor along with tapcis.
I guess you'll just have to figure out where to put the carriage returns.
Good luck
John
There are 3 Replies.
Press <CR> for next or type CHOICES !
H#: 65089 S12/SPECTRA Publishing
11-Sep-90 06:33:31
Sb: #65050-Peace and Quiet !
Fm: Dan Robins 70007,3264
To: John Watts 73760,751
John,
I don't use TAPCIS....but to POST UNFORMATTED would take care of
the problem.
Dan
Press <CR> for next or type CHOICES !
H#: 65100 S12/SPECTRA Publishing
11-Sep-90 07:33:22
Sb: #65050-Peace and Quiet !
Fm: Paul Johnson 73577,646
To: John Watts 73760,751
John -
When using TAPCIS, or anything else to upload a text file, if you want to
preserve the appearance of the original file, insert a space at the beginning
of each line in the editor, before uploading/transmitting it. This includes
blank lines, which should contain 1 space. See these examples:
Line 1 - This line has a leading space.
Line 2 - This line has a leading space.
Line 1 - This line has a leading space. Line 2 - There's no leading space
here, so it should have wrapped onto the end o preceding line (compuserve does
this automatically)
It's a common problem, but an easy solution. If you used a WP program to
compose your messages or files, you could set the left margin to 1 character
and print to an ASCII file. TB/PB won't let you set a left margin, nor will it
support blank lines with a single space, so it's not an ideal editor for these
purposes.
Hope that helps - good luck!
- Paul
Press <CR> for next or type CHOICES !
H#: 65103 S12/SPECTRA Publishing
11-Sep-90 07:47:32
Sb: #65050-Peace and Quiet !
Fm: Bob Zale: PowerBASIC R&D 76304,1303
To: John Watts 73760,751
Thanks for the example code, John. I'm sure many will find it interesting.
Thanks for the "pat on the back", too! My ego loves it!
Bob Zale (PowerBASIC R&D)
Press <CR> for next or type CHOICES !
H#: 65093 S12/SPECTRA Publishing
11-Sep-90 06:51:23
Sb: #64657-#Peace and Quiet !
Fm: Mason Landstreet 71220,1547
To: Bob Zale: PowerBASIC R&D 76304,1303 (X)
Bob,
I'm already sold. How do I sign upso my name will be near the top of the list?
Thanks..........................................Mason
There is 1 Reply.
Press <CR> for next or type CHOICES !
H#: 65104 S12/SPECTRA Publishing
11-Sep-90 07:50:14
Sb: #65093-Peace and Quiet !
Fm: Bob Zale: PowerBASIC R&D 76304,1303
To: Mason Landstreet 71220,1547
We'll have a formal announcement of PowerBASIC #2.10 very shortly. Just stay
tuned a couple of days, Mason. Thanks for your interest!
Bob Zale (PowerBASIC R&D)
Press <CR> for next or type CHOICES !
H#: 65096 S12/SPECTRA Publishing
11-Sep-90 06:55:57
Sb: #64661-#Peace and Quiet !
Fm: Mason Landstreet 71220,1547
To: Bob Zale: PowerBASIC R&D 76304,1303 (X)
Bob,
How long do you think it will be before mandatory use of the CALL keyword for
accessing uer defined functions will be done away with?
Mason
There is 1 Reply.
Press <CR> for next or type CHOICES !
H#: 65105 S12/SPECTRA Publishing
11-Sep-90 07:51:30
Sb: #65096-Peace and Quiet !
Fm: Bob Zale: PowerBASIC R&D 76304,1303
To: Mason Landstreet 71220,1547
An optional "CALL" keyword is destined for the next major version of PB.
Bob
Press <CR> for next or type CHOICES !
H#: 65099 S12/SPECTRA Publishing
11-Sep-90 07:18:18
Sb: #Structures
Fm: Mason Landstreet 71220,1547
To: Bob Zale
Bob,
How about real structures so we can do away with CVI, CVS, CVL, CVD, MKI$,
MKS$, MKL$, MKD$. Before you answer this let me look at FLEXSTRINGS one more
time. If FLEXSTRINGS will let me push numeric variables into them without the
conversions or if there is another method I have missed it. If FLEXSTRINGS
won't do this go ahead and answer.
Thanks...........................................Mason
There is 1 Reply.
Press <CR> for next or type CHOICES !
H#: 65101 S12/SPECTRA Publishing
11-Sep-90 07:43:34
Sb: #65099-Structures
Fm: Bob Zale: PowerBASIC R&D 76304,1303
To: Mason Landstreet 71220,1547
Mason --
MAPping flex strings still require conversion functions. The big advantage
is the fact it's dynamic. The size and content of the structure may be
determined at run-time, not compile-time. Yes, it would be more convenient to
allow direct numeric access. It's very high on our list.
Bob Zale (PowerBASIC R&D)
Press <CR> for next or type CHOICES !
HPC Vendor B ForumHSections Menu
Section names (#subjs/# msgs)
1 Quarterdeck (54/112)
2 Primavera Systems (1/1)
3 Korenthal Assocs. (2/3)
4 Personics Corp. (13/34)
5 Quicksoft (3/4)
6 TurboPower Software (39/85)
8 DacEasy (6/7)
10 J.P. Software (16/46)
11 PDC Prolog (5/10)
12 SPECTRA Publishing (2/12)
HEnter choice(s) or ALL !