- Timestamp:
- Feb 18, 2022, 10:31:00 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UVCardHighlighter.pas
r115 r118 157 157 var 158 158 I: Integer; 159 begin 159 DecimalPointUsed: Boolean; 160 begin 161 DecimalPointUsed := False; 160 162 if Length(Text) > 0 then begin 161 163 Result := True; 162 164 for I := 1 to Length(Text) do begin 163 if not IsDigit(Text[I]) then begin165 if not IsDigit(Text[I]) and not (not DecimalPointUsed and (Text[I] = '.')) then begin 164 166 Result := False; 165 167 Break; 166 168 end; 169 if Text[I] = '.' then DecimalPointUsed := True; 167 170 end; 168 171 end else Result := False; … … 215 218 var 216 219 L: Integer; 220 DecimalPointUsed: Boolean; 217 221 begin 218 222 // FTokenEnd should be at the start of the next Token (which is the Token we want) … … 227 231 228 232 L := Length(FLineText); 229 If FTokenPos > L then 233 If FTokenPos > L then begin 230 234 // At line end 231 Exit 235 Exit; 236 end 232 237 else 233 238 if FLineText[FTokenEnd] in [#9, ' '] then begin … … 240 245 end else 241 246 if IsDigit(FLineText[FTokenEnd]) then begin 242 while (FTokenEnd <= L) and IsDigit(FLineText[FTokenEnd]) do 247 DecimalPointUsed := False; 248 while (FTokenEnd <= L) and (IsDigit(FLineText[FTokenEnd]) or 249 (not DecimalPointUsed and (FLineText[FTokenEnd] = '.'))) do begin 250 if FLineText[FTokenEnd] = '.' then DecimalPointUsed := True; 243 251 Inc(FTokenEnd); 252 end; 244 253 end else begin 245 254 // At None-Space? Find end of None-spaces
Note:
See TracChangeset
for help on using the changeset viewer.