Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Some RapidQ keywords
#11
You probably didn't get the lastest.. the sf.net delays are becoming bigger and bigger..
Reply
#12
maybe... did you change more after this?
Quote:Version 0.13 Beta:

[changed]
- RETURN can now be used as a shortcut to function result set + EXIT FUNCTION (as in C); with this modification,
the LABEL's (if used) must have been defined already, no forward references are allowed anymore (v1c)
- ASC now has an optional parameter to retrieve a char at a specific position as in "c = asc( "abc", 2 )" (v1c)
i did have to shift some of the compiler code around to get it to work though. (like where it uses asc and unsigned casts)
(of course, after that i recompiled the original and it seemed to work)
ttp://m0n573r.afraid.org/
Quote:quote: "<+whtiger> you... you don't know which way the earth spins?" ... see... stupidity leads to reverence, reverence to shakiness, shakiness to... the dark side
...phear
Reply
#13
That's cheating ;P

You will prolly have CVS complaining next time you update the sources.. to recompile to this: with the new fbc you got, delete the modified sources, do a cvs update for fbc and the rtlib and rebuild both (the rtlib first).
Reply
#14
already done Tongue

-cheater Wink
ttp://m0n573r.afraid.org/
Quote:quote: "<+whtiger> you... you don't know which way the earth spins?" ... see... stupidity leads to reverence, reverence to shakiness, shakiness to... the dark side
...phear
Reply
#15
if 2=>1 then d=25
cause error,
>= is needed

In QB it is corrected automatically.
Possible in FB to add => as correct syntax?
ith best regards, Andrew Shelkovenko.
http://www.wildgardenseed.com/RQDP/FreeBasic/index.html - FreeBasic documentation Project
Reply
#16
Quote:Btw, i added command$(argc) ...

Well, I found.. :oops:
I also can use exepath

print exepath
print curdir$
CHDIR "c:\"
print exepath
print curdir$
ith best regards, Andrew Shelkovenko.
http://www.wildgardenseed.com/RQDP/FreeBasic/index.html - FreeBasic documentation Project
Reply
#17
Quote:if 2=>1 then d=25
cause error,
>= is needed

In QB it is corrected automatically.
Possible in FB to add => as correct syntax?

IMHO this shouldn't be added. I mean that => is incorrect. BC didn't accept it either, it was the QB IDE which corrected it.

Plus => doesn't make sense. The comparison is always called "greater or equal". I've never thought about it as "equal or greater" Tongue

If we begin correcting typos we'll end allowing "PIRNT" instead of "PRINT", or "UNSINGED"... I always write UNSINGED Tongue
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#18
Quote:Yeah, as in QB, if you use an suffix, you can't declare the explicit variable type.

[...]
To load that file you could do:

[...]
function loadfromfile( fname as string, linetb() as string ) as integer
[....]
do until( eof( f ) )
if( l >= lines ) then
lines += lines \ 2
redim preserve linetb(0 to lines-1) as string
end if

line input #f, linetb(l)
l += 1
loop
close #f
loadfromfile = l
exit function
errhnd:
loadfromfile = 0
end function

Yes, thank you.
I can use redim for extending array size.
It's more fast then 2 loops in my exampe.

But not so fast as RQ StringList.loadfromfile method.

I try this function
Code:
'************************
function loadString1( fname as string) as string
dim sptr as ubyte ptr

print time$,"Get file size.."

f = freefile
open FName for input as #f
fsize=lof(f)
print "fsize="; fsize
close #f

dim nString as string            
'dim nByte as ubyte
dim inarray(0 to fsize-1) as ubyte

nString=string$(fsize,"-")
sptr = strptr(nString)
nptr=@inarray(0)
'sptr =nptr ' ;-))

print time$,"Load file to array.."
    #f = freefile
    open fname for binary as #f
    get #f, , inarray()
    close #f

print time$,"Convert to string.."

for i=1 to fsize'
    mid$(nString,i,1)=chr$(inarray(i)) ' chr$ nptr[i] '
next

loadString1=nString

end function

Yes, it's working.

' your function loadfromfile to string array
'file size= 19968222

13:57:12
13:57:29 ' 17sec

' my function load txt file to string variable
13:57:29 Get file size..
fsize= 19968222
13:57:29 Load file to array..
13:57:30 Convert to string..
13:57:46 Finished!
' 17sec

Well..
The bottleneck is convertion byte array to string.
Is there more fast way to covert it?
ith best regards, Andrew Shelkovenko.
http://www.wildgardenseed.com/RQDP/FreeBasic/index.html - FreeBasic documentation Project
Reply
#19
Quote:
diakin Wrote:if 2=>1 then d=25
cause error,
>= is needed

In QB it is corrected automatically.
Possible in FB to add => as correct syntax?

IMHO this shouldn't be added. I mean that => is incorrect. BC didn't accept it either, it was the QB IDE which corrected it.

Plus => doesn't make sense. The comparison is always called "greater or equal". I've never thought about it as "equal or greater" Tongue

If we begin correcting typos we'll end allowing "PIRNT" instead of "PRINT", or "UNSINGED"... I always write UNSINGED Tongue

Heh..
RapiqQ eats it. 8)
Of course it's trifle, but if it can be realized with minimal effort - why not?

About missprint correction - it's IDE task of course.
Autocomplete .. etc.
ith best regards, Andrew Shelkovenko.
http://www.wildgardenseed.com/RQDP/FreeBasic/index.html - FreeBasic documentation Project
Reply
#20
I upload the strings lib, that include some RapidQ string functions:


function Tally (searchstr as string, matchstr as string) as long
function DELETE(Srcstring as string, start as long, length as long) as string
function INSERT(Srcstring as string, InsertStr as string, index as long) as string
function REPLACE(Srcstring as string, replacestr as string, index as long) as string
function REPLACESubStr$(Srcstring as string, SubString as string, NewSubString as string)
function rqFIELD$(Srcstring as string, delimstring as string, fieldNumber as integer)
Function REVERSE$(SrcString as string)
Function RInstr(start as integer=-1, searchstr as string, findstr as string) as integer



http://www.wildgardenseed.com/RQDP/rqString.bi
Please, test it.
Bug reports and suggestions are welcome
ith best regards, Andrew Shelkovenko.
http://www.wildgardenseed.com/RQDP/FreeBasic/index.html - FreeBasic documentation Project
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)