strange conversion result value code = 2


, Using value(string, zahl, code) I am used to get 0 for a successful conversion and 1 for a negativ result. But this time, using 'EA' as string (Electron) I got the result code := 2 !!! What does this ...
Posted On: Thursday 22nd of November 2012 11:51:15 PM Total Views:  145
View Complete with Replies

RELATED TOPICS OF Delphi Programming PROGRAMMING LANGUAGE




conversion tool to derive CFG from DOF?

Does anyone know of a tool to convert from DOF to a CFG file I'm dealing with D6, and really want to convert to command-line compiler builds. -- Bill
VIEWS ON THIS POST

100

Posted on:

Wednesday 26th September 2012
View Replies!

number conversion (any base to any base) :)

Hi all, I'd thought I'd share a routine I created with you all in case you find it useful :-) Function BaseToBaseConversion(Const AInNumber : String; Const AInBase,AOutBase : Byte; Const AMinOutBaseDigits : Byte) : String; // Inputs: // AInNumber = input number to convert from (base 2 - 36) // AInBase = input base number (2 - 36) // AOutBase = input base number (2 - 36) // AMinOutBaseDigits = minimum number of 'digits' to use in the output string // // Outputs: // Result = the AInNumber converted to the AOutBase base (if possible) Const cDigits = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'; Var Decimal : LongInt; Remainder : LongInt; Power : Integer; DigitValue : Integer; Index : Integer; Begin Result := ''; If Not(AInBase In[2..36]) Then Exit; If Not(AOutBase In[2..36]) Then Exit; If AInNumber = '' Then Exit; Decimal := 0; Power := 1; For Index := Length(AInNumber) Downto 1 Do Begin DigitValue := Pos(AInNumber[Index],cDigits) - 1; If DigitValue < 0 Then Exit; // illegal input digit found so bomb out Decimal := Decimal + Power * DigitValue; Power := Power * AInBase; End; If Decimal = 0 Then Begin Result := cDigits[1]; Exit; End; While Decimal 0 Do Begin Remainder := Decimal Mod AOutBase; Decimal := Decimal Div AOutBase; Result := cDigits[Remainder + 1] + Result; End; For Index := 1 To (AMinOutBaseDigits - Length(Result)) Do Result := cDigits[1] + Result; End; If you find it useful, enjoy Cheers, Paul. "The plastic veneer of civilization is easily melted in the heat of the moment" - Paul Nicholls. paulfnicholls@gmail.NOSPAM.com Remove ".NOSPAM" to reply.
VIEWS ON THIS POST

119

Posted on:

Monday 1st October 2012
View Replies!

PixelFormat conversion

Hi all, anybody knows how a palette is computed when I change the PixelFormat of a pf24bit bitmap to pf1bit. Is there some algorithm in GDI (or perhaps VCL) which would compute the palette or do I have to implement the tresholding by myself. Jindra
VIEWS ON THIS POST

91

Posted on:

Wednesday 3rd October 2012
View Replies!

When to destroy a created result?

If have a function in which I create and fill a stringlist, I presume it is the task of the calling function to destroy the result right Like begin //some piece of coding .... myList := MyO.ConstructMyStringList(); .... .... .... myList.Destroy(); .... .... end; function TMyObject.ConstructMyStringList(); begin result := TStringList.Create() result.Add('Sjors'); result.Add('is'); result.Add('a'); result.Add('nuthead'); end;
VIEWS ON THIS POST

77

Posted on:

Wednesday 3rd October 2012
View Replies!

change buttonl status based on query results

I have a form with a dbgrid that is populated by a adoquery. The adoquery is defined in a data module. Each time a filter is applied on the query, i want to enable/disable command buttons in the form based on the number of rows that result from the filter.. how can i achieve this.. TIA rgds sriram
VIEWS ON THIS POST

76

Posted on:

Friday 5th October 2012
View Replies!

C to pascal conversion

In trying to convert a C++ program to Delphi (using D7) I've come across the following: sscanf(pData, "%4hx", &(m_Data[Address - m_Address])); I found a lib that provides sscanf functionality in Delphi, however I'm at a loss as to how to make &(m_Data[Address - m_Address]) conform to "array of Pointer" (function sscanf(Str : PChar; Format : PChar; Pointers : array of Pointer): Integer It's been WAY too long since I've worked in C. TIA. EdB
VIEWS ON THIS POST

82

Posted on:

Friday 5th October 2012
View Replies!

strange compiler error

, after compiling (a VCL.NET application, RAD Studio 2007) I frequently get the error: [DCC Fehler] F2084 Interner Fehler: AV06F73C6E-R00000B67-0 What's that
VIEWS ON THIS POST

282

Posted on:

Friday 5th October 2012
View Replies!

GlobalMemoryStatus function -- odd results

I'm trying to check for mem leaks & stumbled onto an article regarding the GlobalMemoryStatus method. I call it before executing some code, remember the results, then call it after. The surprising result is that after showing various forms and freeing them, creating and freeing various custom objects, I have more memory than ever. Total Memory, memory load, total page file and total virtual remain unchanged. Available memory increases by over 4gb. So does avail page file (but about a MB less than memory). Working memory is up by 408 KB. Sounds like this function is not a very good guide, but then maybe I'm missing something. Here's my code: oMem1 := TMemStats.Create; oMem2 := TMemStats.Create; oMem3 := TMemStats.Create; oMem1.getMemStats; goloans2(plno,guser); oMem2.getMemStats; oMem3.computeDelta(oMem1,oMem2); ShowMessage(oMem3.deltaString); oMem1.Free; oMem2.Free; oMem3.Free; procedure TMemStats.computeDelta(oMem1, oMem2: TObject); begin totalMemory := TMemStats(oMem2).totalMemory-TMemStats(oMem1).totalMemory; availMemory := TMemStats(oMem2).availMemory-TMemStats(oMem1).availMemory; memoryLoad := TMemStats(oMem2).memoryLoad-TMemStats(oMem1).memoryLoad; totalPageFile:= TMemStats(oMem2).totalPageFile-TMemStats(oMem1).totalPageFile; availPageFile:= TMemStats(oMem2).availPageFile-TMemStats(oMem1).availPageFile; totalVirtual := TMemStats(oMem2).totalVirtual-TMemStats(oMem1).totalVirtual; availVirtual := TMemStats(oMem2).availVirtual-TMemStats(oMem1).availVirtual; workingMemory:= TMemStats(oMem2).workingMemory-TMemStats(oMem1).workingMemory; end;
VIEWS ON THIS POST

79

Posted on:

Tuesday 9th October 2012
View Replies!

Getting the result code of an external app.

Is there some way I have an external console application that returns a code: 0-no error, 1-file not founs, etc- I use CreateProcessAsUser to launch the console app as an administrator. It does it's thing and returns the code. Is there any way for my app to get that result
VIEWS ON THIS POST

49

Posted on:

Wednesday 10th October 2012
View Replies!

PixelFormat conversion

Hi all, anybody knows how a palette is computed when I change the PixelFormat of a pf24bit bitmap to pf1bit. Is there some algorithm in GDI (or perhaps VCL) which would compute the palette or do I have to implement the tresholding by myself. Jindra
VIEWS ON THIS POST

49

Posted on:

Tuesday 16th October 2012
View Replies!

strange compiler error

, after compiling (a VCL.NET application, RAD Studio 2007) I frequently get the error: [DCC Fehler] F2084 Interner Fehler: AV06F73C6E-R00000B67-0 What's that
VIEWS ON THIS POST

223

Posted on:

Tuesday 16th October 2012
View Replies!

change buttonl status based on query results

I have a form with a dbgrid that is populated by a adoquery. The adoquery is defined in a data module. Each time a filter is applied on the query, i want to enable/disable command buttons in the form based on the number of rows that result from the filter.. how can i achieve this.. TIA rgds sriram
VIEWS ON THIS POST

67

Posted on:

Tuesday 16th October 2012
View Replies!

C to pascal conversion

In trying to convert a C++ program to Delphi (using D7) I've come across the following: sscanf(pData, "%4hx", &(m_Data[Address - m_Address])); I found a lib that provides sscanf functionality in Delphi, however I'm at a loss as to how to make &(m_Data[Address - m_Address]) conform to "array of Pointer" (function sscanf(Str : PChar; Format : PChar; Pointers : array of Pointer): Integer It's been WAY too long since I've worked in C. TIA. EdB
VIEWS ON THIS POST

73

Posted on:

Tuesday 16th October 2012
View Replies!

How to over-write values in a log file

Hi , I have a log file I am writing to during a process I am running. Each line lists a table and a value at the end. The value will always be a 3 digit number as in : Start Log At 4:15 PM Table1 026 Table2 056 What I need to do is update the value as the process runs. But I don't know how many times the number will be updated. So what I want to do is write the value, and then if it is updated, write the new value over the top of the old one. How can I do this. I am using TextFiles and using Append to add to the file. In the above example, if a new value for Table2 was received, I want to over-write the 056 and replace it with 078 (or what ever). I will only ever update the last table in the log file. Once I move to another table, the previous table is finished with. And I'll write the value with Write (and not WriteLn). Any ideas how I can do this Cheers, Paul
VIEWS ON THIS POST

187

Posted on:

Tuesday 16th October 2012
View Replies!

canvas.textheight return value problem

canvas.textheight(str) always seems to return the same value, regardless of the string parameter used. That is, except for '' (where it returns 0), using 'jT' or '.' makes no difference. what could be wrong Frank. PS: I'm trying to 'correct' canvas.TextWidth when using fsItalic
VIEWS ON THIS POST

281

Posted on:

Tuesday 16th October 2012
View Replies!

Saving list box values to the registry

Hi , whats the best way to save a list boxes values to the registry. I know I could cycle through each one, but i think there's a better way. Any ideas Cheers, Paul...
VIEWS ON THIS POST

153

Posted on:

Saturday 10th November 2012
View Replies!

BDS2006 Delphi debugger stops in strange place...

I have an application that I wrote more than a year ago, which I have to modify now. I used BDS2006 at the time and that is what I use now too. My problem is that I have a timer ...
VIEWS ON THIS POST

253

Posted on:

Thursday 15th November 2012
View Replies!

BDS 2006 - strange problem...

Since couple of days I'm using BDS 2006 and strange thing happens during form edition. Let say that I have a form with panel on it. I'm selecting this panel and drag a label onto this panel. label become child ...
VIEWS ON THIS POST

316

Posted on:

Thursday 15th November 2012
View Replies!

Very strange MDI Minimize Problem

, Delphi 2007 Update 3 in our application we have a very strange problem with minimized MDI Windows. If the user is minimizing some windows and changing between other windows, suddently one of the minimized windows has no control boxes ...
VIEWS ON THIS POST

74

Posted on:

Thursday 22nd November 2012
View Replies!

strange COM+ properties behaviour

all, I developed a COM+ dll application with Delphi7, it contains two properties PMax and Manner, the Manner can be set to 0 or 1 meaning read or set PMax value from or to the backend database, otherwise it ...
VIEWS ON THIS POST

37

Posted on:

Thursday 22nd November 2012
View Replies!