Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
File INPUT/OUTPUT
#11
Use FREEFILE. Always.
Reply
#12
Quote:Use FREEFILE. Always.
Uh oh! *runs* Should I start using it too?

I mean I know how hard it is to edit a line of code for opening the .bmp (Why they would want to change anything I do not know)
will Live Forever, or Die Trying >_<;;
Reply
#13
what if you distribute a binary? gonna just "edit that out" :|
Reply
#14
Then file numbers shouldn't be a problem. FREEFILE is a tool of portability, for open-source.
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Reply
#15
If you don't want freefile then number each file from #1 and up for your program, then but another number in front of that one so you would end up with 11,12,13 or 421,422,423 etc.
Reply
#16
once again, i am silenced by the experts..
Reply
#17
Quote:If you don't want freefile then number each file from #1 and up for your program, then but another number in front of that one so you would end up with 11,12,13 or 421,422,423 etc.
WTF? What opens 423 files from one app? Maybe an OS?
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Reply
#18
No, not actually openeing 423 files, just opening that file as #423, to prevent opening 2 or more files with same number
Reply
#19
If everybody used that, it would be useless.
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Reply
#20
i just looked to see if you were right, you arent. fb calls a runtime function when using freefile, so when you compile a binary, it is still
important to have used FREEFILE.


Code:
? "hello"
Dim As Integer f
f = FreeFile
becomes
Code:
    .intel_syntax noprefix

    #sda.bas' compilation started at 05:07:05 (FreeBASIC v0.16b)

.section .text
.balign 16

.globl _main
_main:
push ebp
mov ebp, esp
and esp, 0xFFFFFFF0
sub esp, 8
mov dword ptr [ebp-8], 0
mov dword ptr [ebp-4], 0
call ___main
push dword ptr [ebp+12]
push dword ptr [ebp+8]
call _fb_Init@8
.Lt_0001:
push 1
push 5
push offset Lt_0003
call _fb_StrAllocTempDescZEx@8
push eax
push 0
call _fb_PrintString@12
call _fb_FileFree@0 ;<--- I keep your app from puking under unexpected conditions
mov dword ptr [ebp-8], eax
.Lt_0002:
push 0
call _fb_End@4
mov eax, dword ptr [ebp-4]
mov esp, ebp
pop ebp
ret
    #sda.bas' compilation took 1.825374210980613e-003 secs
    #global initialized constants

.section .data
.balign 16
.balign 4
Lt_0003:    .ascii    "hello\0"
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)