Posts: 602
Threads: 27
Joined: Oct 2004
guess it's time for this thread...
and vonGodric just found a neat one...
try to compile the fmodtest.bas and check the asm source. on line 519-520 it tries to push ~ on the stack, dunno bout you but i don't know that register.
have fun
edit: one more
D:\FREEBA~1>fbc examples\optargs.bas
examples\optargs.o(.text+0x1d):fake: undefined reference to `FOO@12'
examples\optargs.o(.text+0x26):fake: undefined reference to `BAR@8'
uh oh..., ok it might be just a show off, but a n00b or that helium guy will complain...
quote="NecrosIhsan"]
![[Image: yagl1.png]](http://www.nodtveidt.net/yagl1.png)
[/quote]
Posts: 658
Threads: 71
Joined: Sep 2003
this code is erronous.
Code:
defint a-z
option explicit
type struct
Xpos as integer
ypos as integer
x1pos as integer
y1pos as integer
Name as string * 15
Cmdd as sub() 'doesn't seem to allow passing amty parameter list
end type
url]http://fbide.sourceforge.net/[/url]
Posts: 922
Threads: 15
Joined: Jun 2003
Alright, all fixed, thanks mates..
Version 0.02b uploaded, will start to release just patches soon ;)
Posts: 729
Threads: 104
Joined: Jan 2003
The right$ function isn't supposed to reverse the string. It's just supposed to return the characters starting X from the right, to the end.
The current code doesn't run correctly in FB:
Code:
a$ = "Hell is a place on earth"
a$ = LEFT$(a$, 3)
a$ = a$ + LCASE$(LEFT$("Low man's Lyric is a favourite song of mine.", 2))
b$ = "Now we see the truth."
a$ = a$ + " " + UCASE$(MID$(b$, 3, 1)) + MID$(b$, 2, 1)
b$ = "Girls are yucky"
a$ = a$ + LCASE$(LEFT$(RIGHT$(b$, LEN(b$) - INSTR(b$, "i")), INSTR(b$, "r") - 1)) + "d"
PRINT a$
SLEEP
I'll be checking more of the text functions sooner or later. For now I need to sleep. (edited because instr works, so I updated the program to show that)
Posts: 922
Threads: 15
Joined: Jun 2003
Fixed.. man, that was a stupid bug, i never used right$ for anything but getting the last character, no wonder it worked.
Btw, runtime library was barelly tested, new surprises can appear.. that why i released a beta version ;)
Posts: 3,522
Threads: 189
Joined: Dec 2003
PRINT SPACE$(100)
Or anything longer then the console widht...
Makes it crash in windows 98
Posts: 3,522
Threads: 189
Joined: Dec 2003
Code:
dim a as long
print len(a)
4?, same as integer...?
Posts: 922
Threads: 15
Joined: Jun 2003
No clue, that space$(100) test works fine on XP, i can't believe Win 9x can't print more than 80 chars p/ time, didn't see that limitation at the SDK docs, ow.
Yeah, an integer is 32-bit in FB, LONG is just an alias. If you really want a 16-bit integer, you have to declare them as "short" or "ushort" for unsigned ints. Using 16-bit integers would generate pretty bad code on new CPU's, size prefixes all the time.
Posts: 3,522
Threads: 189
Joined: Dec 2003
I meant that a long is supposed to be a long integer, thus, in freebasic it would mean 8bytes, or 64bit
Posts: 3,522
Threads: 189
Joined: Dec 2003
Is there a way to make PRINT Astring$
Work the same way as QB?, that is with wrap around etc?