[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4752: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3887)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4754: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3887)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4755: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3887)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4756: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3887)
Liberty BASIC Holland • Toon onderwerp - Binary file access

Binary file access

Nieuwe Liberty BASIC programmeurs kunnen hier om hulp vragen.

Moderators: anthonio, Abcott

Binary file access

Berichtdoor TvdHonert » za maart 20, 2010 10:25 pm

Beste mensen,

Ik loop een beetje stuk op de manier waarmee LB omgaat met binary files.
Bij een lees opdracht denk ik bv 4 karakters te lezen. In werkelijkheid worden er 128 karakters gelezen.
Ook bij het schrijven krijg ik wonderlijke resultaten.

txt$=" "
input #1,txt$

Alvast bedankt

Taco
TvdHonert
 
Berichten: 3
Geregistreerd: ma jul 27, 2009 6:21 pm

Re: Binary file access

Berichtdoor Gordon » zo maart 21, 2010 12:29 am

Ik vermoed dat je mijn opmerking een dooddoener zult
vinden. Opmerking: Gebruik gewoon seek om de filepointer te
positioneren en gebruik daarna input$(#xx,aantal) om het
aantal karakters te lezen.

Het verschil tussen Binary en sequentiele bestanden
komt alleen neer op het commando seek. En ik heb reeds
aangetoond dat seek zowel in binaire als sequentiele bestanden
werkt.

Dat staat niet in de help file en Carl zei dat het ook niet zijn
bedoeling was, en dus dat deze "feature" er misschien ooit uit gaat.

Gordon
Avatar gebruiker
Gordon
Site Admin
 
Berichten: 684
Geregistreerd: zo mei 22, 2005 12:50 am

Re: Binary file access

Berichtdoor Gordon » zo maart 21, 2010 12:36 am

Ok, mijn vorige bericht was wat kort door de bocht.
Binaire bestanden doen tegelijk wat sequentiele INPUT
en OUTPUT bestanden apart doen.
Binaire bestanden kennen naast seek ook de loc(#) functie.

Gordon
Avatar gebruiker
Gordon
Site Admin
 
Berichten: 684
Geregistreerd: zo mei 22, 2005 12:50 am

Re: Binary file access

Berichtdoor TvdHonert » zo maart 21, 2010 12:09 pm

Gordon,
Bedankt voor het antwoord. Jammer dat de benadering met het input$ commando niet in het helpscherm te vinden is. Ook Index Companion geeft hier geen uitleg over.
Groeten Taco
TvdHonert
 
Berichten: 3
Geregistreerd: ma jul 27, 2009 6:21 pm

Re: Binary file access

Berichtdoor Gordon » zo maart 21, 2010 12:54 pm

Ja, dit is een soort valse schaamte van Carl (LB).
Sommige vindingen worden niet genoemd, omdat
ze in andere talen niet voorkomen.

De uitvinding input$() is er zo één.
Binaire bestanden zijn eenvoudiger dan sequentiële,
want je hoeft slechts 1x te openen voor lezen/schrijven en
append. Natuurlijk m.b.v. de loc() functie en seek.
In feite is de hele file handling drastisch vereenvoudigd
in LB. Alle convertie functies zoals (MKI()-CVI() LSET RSET)
zijn afgeschaft.

Toch heeft niemand Binaire bestanden ooit beschreven
op de Wiki Space.


Gordon
Avatar gebruiker
Gordon
Site Admin
 
Berichten: 684
Geregistreerd: zo mei 22, 2005 12:50 am


Keer terug naar Beginner

Wie is er online

Gebruikers op dit forum: Geen geregistreerde gebruikers. en 1 gast

cron