File i/o

FBS (freeBASIC script) is an interpreter for FbCadCam macros and a server side script engine.

Moderators: kitty_webb, Ywsp, joanCruz03, yajra1219, Jayem, shela

Post Reply
owen
Site Admin
Posts: 650
Joined: Thu Apr 13, 2017 12:14 pm

File i/o

Post by owen » Thu Sep 19, 2019 7:42 pm

I added file i/o functions:
Open
Close
Eof
Lof
Freefile
Input #
Line Input #
Print #
Get #
Put #

For example:
Dim a string s
Dim as integer i
Open 'file_name.txt" for input as #1
Do While Not Eof(1)
Input #1, i, s
Print i, s
Loop
Close #1

owen
Site Admin
Posts: 650
Joined: Thu Apr 13, 2017 12:14 pm

Re: File i/o

Post by owen » Mon Sep 23, 2019 4:43 am

Files can be opened using access modes:
Input
Output
Append
Binary

Note: random access mode is not available as of this post.

Post Reply