mirror of
https://github.com/QB64-Phoenix-Edition/QB64pe.git
synced 2024-09-16 20:14:17 +00:00
parent
fb10bdb7f8
commit
ea4656d51c
1 changed files with 7 additions and 15 deletions
|
@ -13059,7 +13059,7 @@ void sub_open(qbs *name,int32 type,int32 access,int32 sharing,int32 i,int64 reco
|
||||||
if (type==1){//set record length
|
if (type==1){//set record length
|
||||||
f->record_length=128;
|
f->record_length=128;
|
||||||
if (passed) if (record_length!=-1) f->record_length=record_length;
|
if (passed) if (record_length!=-1) f->record_length=record_length;
|
||||||
f->field_buffer=(uint8*)calloc(f->record_length,1);
|
f->field_buffer=(uint8*)calloc(record_length,1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type==5){//seek eof
|
if (type==5){//seek eof
|
||||||
|
@ -15798,11 +15798,8 @@ void sub_put2(int32 i,int64 offset,void *element,int32 passed){
|
||||||
//returns a string to advance to the horizontal position "pos" on either
|
//returns a string to advance to the horizontal position "pos" on either
|
||||||
//the current line or the next line.
|
//the current line or the next line.
|
||||||
static int32 w,div,cursor;
|
static int32 w,div,cursor;
|
||||||
|
|
||||||
static int32 cr_size; // a local in case file is SCRN
|
|
||||||
cr_size = tab_spc_cr_size; // init to caller's value
|
|
||||||
//calculate width in spaces & current position
|
//calculate width in spaces & current position
|
||||||
if (cr_size==2){
|
if (tab_spc_cr_size==2){
|
||||||
//print to file
|
//print to file
|
||||||
div=1;
|
div=1;
|
||||||
w=2147483647;
|
w=2147483647;
|
||||||
|
@ -15813,14 +15810,9 @@ void sub_put2(int32 i,int64 offset,void *element,int32 passed){
|
||||||
if (i<0) goto invalid_file;//TCP/IP unsupported
|
if (i<0) goto invalid_file;//TCP/IP unsupported
|
||||||
if (gfs_fileno_valid(i)!=1) goto invalid_file;//Bad file name or number
|
if (gfs_fileno_valid(i)!=1) goto invalid_file;//Bad file name or number
|
||||||
i=gfs_fileno[i];//convert fileno to gfs index
|
i=gfs_fileno[i];//convert fileno to gfs index
|
||||||
if (gfs_file[i].scrn == 1) { // going to screen, change the cr size
|
|
||||||
cr_size = 1;
|
|
||||||
} else {
|
|
||||||
cursor=gfs_file[i].column;
|
cursor=gfs_file[i].column;
|
||||||
}
|
|
||||||
invalid_file:;
|
invalid_file:;
|
||||||
}
|
}else{
|
||||||
if (cr_size == 1) {
|
|
||||||
//print to surface
|
//print to surface
|
||||||
if (write_page->text){
|
if (write_page->text){
|
||||||
w=write_page->width;
|
w=write_page->width;
|
||||||
|
@ -15850,7 +15842,7 @@ void sub_put2(int32 i,int64 offset,void *element,int32 passed){
|
||||||
size=0; spaces=0; cr=0;
|
size=0; spaces=0; cr=0;
|
||||||
if (cursor>pos){
|
if (cursor>pos){
|
||||||
cr=1;
|
cr=1;
|
||||||
size=cr_size;
|
size=tab_spc_cr_size;
|
||||||
spaces=pos/div; if (pos%div) spaces++;
|
spaces=pos/div; if (pos%div) spaces++;
|
||||||
spaces--;//don't put a space on the dest position
|
spaces--;//don't put a space on the dest position
|
||||||
size+=spaces;
|
size+=spaces;
|
||||||
|
@ -15861,8 +15853,8 @@ void sub_put2(int32 i,int64 offset,void *element,int32 passed){
|
||||||
//build custom string
|
//build custom string
|
||||||
tqbs=qbs_new(size,1);
|
tqbs=qbs_new(size,1);
|
||||||
if (cr){
|
if (cr){
|
||||||
tqbs->chr[0]=13; if (cr_size==2) tqbs->chr[1]=10;
|
tqbs->chr[0]=13; if (tab_spc_cr_size==2) tqbs->chr[1]=10;
|
||||||
memset(&tqbs->chr[cr_size],32,spaces);
|
memset(&tqbs->chr[tab_spc_cr_size],32,spaces);
|
||||||
}else{
|
}else{
|
||||||
memset(tqbs->chr,32,spaces);
|
memset(tqbs->chr,32,spaces);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue