Converting a numerical string into an Integer
does not require a library either, but the procedure needs an extra numeric variable (temp=numeric string, mynumeric= integer, real etc):
var code: integer;
val(temp,mynumeric,code);
If 'code' contains zero, the conversion was successful, else...
Fact is you don't need to include a library for that in Turbo pascal.
Simply declare a text variable to hold the result and use 'str' procedure.
var temp: string;
str(number, temp);
Do this conversion from number to text first, then use the 'temp' variable inside the graphic procedure (don't...
Delphi is the best tool for writing Windows programs in pascal language. I don't think you can write real Windows programs in Turbo Pascal.
The Delphi IDE is intuitive, it has the same syntax check as Turbo Pascal and a great help-system (for procedures etc).
The list of supposed events such...
I use to prosess comma or tab separated strings by characters.
For each line in file do:
readln(atextfile,astring){read a line}
col:=0;{reset column}
for i:= 1 to lengt(astring) do{each char in string}
begin
if astring[i]=',' then inc(col) else{found separator}...
(Sorry for breaking in)
When putting new forms and their units in the uses list, what about the opposite direction too?
ie, mainunit uses mydialog and and mydialog uses mainunit, is that not recommended?
My form size is 480 x 640 pixels, screen set to 800 x 600.
Windows XP puts scroll bars on both X and Y, and doesn't remove them when increasing program window. The range of the scrolling is only a few pixels!
Anyone had this problem? I am using Delphi 4, maybe i cannot run my programs on XP then?
I am writing a program until now using a single form and some messagedialogs. Now i would like to create a report that pops up in a new window with 3-4 buttons and memo/string grid.
The buttons in the report are supposed to start one or more processes like printing report, or close the report...
The idea is to not compare each procedure, but using the simple check:
for row1:=1 to lastrow1 do
begin
found:=false;
for row2:=1 to lastrow2 do
if file1[row1].data=file2[row2].data then found:=true;
if not found then file1[row1].changed:=true;
end;
Then the opposite direction. The...
I would use:
procedure TFrmMain.MainProc;
TFrmMain.MainProc1begin
TFrmMain.MainProc2 {funny stuff here}
TFrmMain.MainProc3end;
Actually only lines that are equal in the procedures should have a number added, the numbers are not good id's:
procedure TFrmMain.MainProc;
TFrmMain.MainProc1begin...
Make each line in the files unique by adding labels in front of them. For example procedures should have the procedure name and procedure line number added.
Then search file two for each line in file one, if not found mark it as changed. Do the same the opposite direction.
Make a type...
Thanks again. Is there a 'command' that clears the entire string grid like the program does initially?
The program should have such a line after user klicked 'open file', as the problem develop on the second file...
Thanks, it's working great! Just a pair of q's:
The grid are resized (col,row) according to the data in the file (ie File has 8 columns -> Grid.ColCount:=8). But if a file having different columns (from 2 to 8 cols) are loaded later, some data from the first file show up.
How can i clear the...
I want to import and edit a text file containing tab separated columns. I know how to get it into and display it in the string grid.
But is it possible to use the stringgrid for storing and editing the data or do i have to read the data into an 2D string array first (static buffer)?
Any...
Sometimes people use older pentium fans to cool their AMD CPU's, but they are way too small.
AMD needs a powerful fan and heatsink, and some temperature glue between the CPU and cooler.
I don't know 8051 very well, but usually such chips need a hardware programmer to dump the program.
BASIC code is a high level language, and is translated into machine code in the chip.
My windows system was infected by a strange virus, but i managed to make diskette copies of some code i was working on.
Now I have DOS/windows diskettes with text files and virus. The virus easily copy to DOS machines and develop 'bad sectors' on hard disks (FORM virus??).
Question: is it safe...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.