Changeset 251


Ignore:
Timestamp:
May 17, 2007, 11:21:10 AM (17 years ago)
Author:
dai
Message:

INPUT#ステートメントにおいて、内部バッファのサイズが1バイト分足りないバグを修正。
Val関数で指数部分が読み取れないバグを修正。
sscanf関数(Cランタイム)の定義文を追加。

Location:
Include
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • Include/basic/command.sbp

    r237 r251  
    170170    FileNumber--
    171171
    172     buffer=ZeroString(GetFileSize(_System_hFile[FileNumber],0))
     172    buffer=ZeroString(GetFileSize(_System_hFile[FileNumber],0) + 1)
    173173
    174174    i=0
  • Include/basic/function.sbp

    r237 r251  
    810810    Else
    811811        '10進数
    812         If buf[0]=&H2D Then
    813             'マイナス値
    814             i4=1
    815             buf++
    816         Else
    817             'プラス値
    818             i4=0
    819             If buf[0]=&H2B Then
    820                 buf++
    821             End If
    822         End If
    823 
    824         i=0
    825 
    826         While 1
    827             '数字以外の文字の場合は抜け出す
    828             i3=buf[i]-&H30
    829             If Not (0<=i3 And i3<=9) Then Exit While
    830 
    831             i++
    832         Wend
    833 
    834         '整数部
    835         dbl=1
    836         i3=i-1
    837         While i3>=0
    838             Val += dbl*(buf[i3]-&H30)
    839 
    840             dbl *= 10
    841             i3--
    842         Wend
    843 
    844         If buf[i]=Asc(".") Then
    845             '小数部
    846             i++
    847             dbl=10
    848             While 1
    849                 '数字以外の文字の場合は抜け出す
    850                 i3=buf[i]-&H30
    851                 If Not (0<=i3 And i3<=9) Then Exit While
    852 
    853                 Val += (buf[i] - &H30) / dbl
    854                 dbl *= 10
    855                 i++
    856             Wend
    857         End If
    858 
    859         If i4 Then Val=-Val
     812        sscanf(buf,"%lf",VarPtr(Val))
    860813    End If
    861814End Function
  • Include/crt.sbp

    r119 r251  
    5757#endif
    5858
     59Declare Function sscanf CDecl Lib _CrtDllName (buffer As PSTR, format As PCSTR, ...) As Long
     60
    5961#endif '_INC_CRT
Note: See TracChangeset for help on using the changeset viewer.