mirror of
https://github.com/QB64-Phoenix-Edition/QB64pe.git
synced 2024-09-28 01:47:47 +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
|
### Linux
|
||||||
--->
|
--->
|
||||||
|
|
||||||
<!---
|
|
||||||
## Fixes
|
## Fixes
|
||||||
### All platforms
|
### All platforms
|
||||||
|
- Function `LOC` used on physical files will correctly return zero (0) now for just opened but yet untouched files.
|
||||||
|
|
||||||
|
<!---
|
||||||
### Windows
|
### Windows
|
||||||
|
|
||||||
### macOS
|
### macOS
|
||||||
|
|
|
@ -16325,19 +16325,13 @@ void sub_put2(int32 i,int64 offset,void *element,int32 passed){
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gfs->type==1){//RANDOM
|
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
|
if (gfs->type==2){//BINARY
|
||||||
return gfs_getpos(i);
|
return gfs_getpos(i);
|
||||||
}
|
}
|
||||||
//APPEND/OUTPUT/INPUT
|
//APPEND/OUTPUT/INPUT
|
||||||
int64 pos;
|
return gfs_getpos(i)/128;
|
||||||
pos=gfs_getpos(i);
|
|
||||||
if (!pos) return 1;
|
|
||||||
pos--;
|
|
||||||
pos/=128;
|
|
||||||
pos++;
|
|
||||||
return pos;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
qbs *func_input(int32 n,int32 i,int32 passed){
|
qbs *func_input(int32 n,int32 i,int32 passed){
|
||||||
|
|
Loading…
Reference in a new issue