Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2006-01

StrToQWord seems missing

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Vincent Snijders

Hi,

I want to covert a string to qword, but strtoqword seems to be missing? I could use StrToInt64 like in the program below, but I am worried, that if I recompile the RTL with rangechecks on, StrToInt64 won't be abel to handle these high qword values. Will there be a StrToQWord in the future, or should I use a different solution?

Vincent

program Project1;
{$mode objfpc}{$H+}{$R+}

uses
Classes, SysUtils

   { add your units here };
var
   s: string;
   q: qword;
begin
   s := IntToStr(high(qword));
   writeln(s);
   q := QWord(StrToInt64(s));
   writeln(q);
end.
Vincent Snijders
to Vincent Snijders
Vincent Snijders wrote
Hi, I want to covert a string to qword, but strtoqword seems to be missing?

Attached is a patch to implement StrToQWord and related functions and a test program.

Vincent.

Florian Klaempfl
to Vincent Snijders
Vincent Snijders wrote 9 lines
Vincent Snijders wrote: > Hi, > > I want to covert a string to qword, but strtoqword seems to be missing? Attached is a patch to implement StrToQWord and related functions and a test program.

If you make test programs, please ensure that they can run automated: i.e. illegal results give exit codes 0.