PSN-L Email List Message
Subject: Re: Basic Programming Help desired?
From: Canie canie@...........
Date: Mon, 05 May 2008 09:52:41 -0700
I've worked with basic programming for about 30 years.. no ms basic,
but a flavor of basic.. and whenever we were trying to speed such
things up, it was known that for-next loops were rather slow...
You might play around with a while-wend statements to see if that
executes and faster, or just use a counter and gotos... interesting
test for timing of things..
At 09:15 AM 5/5/2008, you wrote:
>THANK you but this is not the problem I am addressing.
>A/D is not the concern at this time.
>ALL data is saved to an array that resides somewhere
>in MSDOS EMS RAM. What I am trying to do is
>save that array as fast as possible FROM RAM to a file
>residing on hard disk. This lets me turn off the
>disk while the recorder is running and turn on the drive
>only for file operations ( permanent storage ).
>I have always had troubles quickly dealing with
>file formation and lots of bytes.
>If you play with BSAVE command you will
>find it is almost instant unlike my own programs.
>If only I could make a program as fast as BSAVE
>BASIC command then I could do anything I need to
>in this regard very quickly and miss few samples
>Immediately below is the routine which does this
>operation as fast as I have ever done it.
>Comments are welcome.
>$LIB COM ON
>$LIB FULLFLOAT ON
>$LIB VGA ON
>$ERROR BOUNDS ON
>$ERROR NUMERIC ON
>$ERROR OVERFLOW ON
>$ERROR STACK ON
>$COMPILE EXE "TEST.EXE"
>$OPTION CNTLBREAK ON
>DIM VIRTUAL DATA_1?(0:32780)
>' Create a test set of data
>FOR a = 0 to 32780 : DATA_1?(a) = ( 65 + a MOD 58 ) : NEXT a
>' Create the path and filename
>FILE1$ = "c:\data\test.dat"
>' Write The Array in EMS RAM To The File on HARD Drive
>PRINT "NOW SAVING DATA TO FILE c:\data\test.dat "
>OPEN FILE1$ FOR BINARY AS #1
>FOR ka = 0 to 7
> tmpz1$ = ""
> For kb = 0 to 4095
> kc = (( ka * 4096 ) + kb )
> tmpz1$ = tmpz1$ + chr$(DATA_1?(kc))
> NEXT kb
> kd = ( ka * 4096 )
> SEEK #1,kd : PUT$ #1,tmpz1$
>tmpz1$ = ""
>FOR ka = 32256 to 32769
> tmpz1$ = tmpz1$ + chr$(DATA_1?(ka))
>SEEK #1,32256 : PUT$ #1,tmpz1$
>tmpz1$ = ""
Public Seismic Network Mailing List (PSN-L)
[ Top ]
[ Back ]
[ Home Page ]