mirror of
https://github.com/QB64-Phoenix-Edition/QB64pe.git
synced 2024-09-27 22:17:51 +00:00
Fixed LOC function for files
Will correctly return zero (0) now for just opened but yet untouched files.
This commit is contained in:
parent
a97311bfbc
commit
c48bf6776e
2 changed files with 4 additions and 9 deletions
|
@ -14,10 +14,11 @@
|
|||
### Linux
|
||||
--->
|
||||
|
||||
<!---
|
||||
## Fixes
|
||||
### All platforms
|
||||
- Function `LOC` used on physical files will correctly return zero (0) now for just opened but yet untouched files.
|
||||
|
||||
<!---
|
||||
### Windows
|
||||
|
||||
### macOS
|
||||
|
|
|
@ -16325,19 +16325,13 @@ void sub_put2(int32 i,int64 offset,void *element,int32 passed){
|
|||
}
|
||||
|
||||
if (gfs->type==1){//RANDOM
|
||||
return gfs_getpos(i)/gfs->record_length+1;
|
||||
return gfs_getpos(i)/gfs->record_length;
|
||||
}
|
||||
if (gfs->type==2){//BINARY
|
||||
return gfs_getpos(i);
|
||||
}
|
||||
//APPEND/OUTPUT/INPUT
|
||||
int64 pos;
|
||||
pos=gfs_getpos(i);
|
||||
if (!pos) return 1;
|
||||
pos--;
|
||||
pos/=128;
|
||||
pos++;
|
||||
return pos;
|
||||
return gfs_getpos(i)/128;
|
||||
}
|
||||
|
||||
qbs *func_input(int32 n,int32 i,int32 passed){
|
||||
|
|
Loading…
Reference in a new issue