Posted: 2008-10-17 12:32:58
What do you mean by input panel ? 

Official Forum
https://forum.antp.be/phpbb3/
Code: Select all
listaserie := '1 Tex' + crlf + '70 Almanacco del Giallo Julia' + crlf;
listaserie := listaserie + '2 Almanacco del west' + crlf + '4 Julia' + crlf + crlf + '2 Julia' + 'Enter comic series:' + crlf;
Input('www.sergiobonellieditore.it', listaserie, ComicSeries); // Asks for comic series number
When you say an easier way, what is easier than using a PickTree - especially for the user ?fulvio53s03 wrote:Good answer about 'picktree' but I would try an easier way: the 'input' panel.
Code: Select all
program NewScript;
var
ComicSeries: string;
begin
PickTreeClear;
PickTreeAdd('Tex Willer', '1');
PickTreeAdd('Almanacco del West', '2');
PickTreeAdd('Julia', '4');
if PickTreeExec(ComicSeries) then
ShowMessage('Series number is: ' + ComicSeries);
end.
Code: Select all
(***************************************************
Ant Movie Catalog importation script
www.antp.be/software/moviecatalog/
[Infos]
Authors=
Title=sergiobonellieditore.it picktree
Description=
Site=http://www.sergiobonellieditore.it/
Language=IT
Version=v.0.1.0
Requires=3.5.0
Comments=
License=
GetInfo=1
[Options]
***************************************************)
program sergiobonellieditore;
uses
StringUtils1; // Script needs external unit StringUtils1.pas in scripts folder !
var
ComicURL, ComicSeries, ComicNumber, Collana: string; // Define some script variables
update: string;
sw_serie : string;
numCollana : integer;
CollanaArray: Array of String;
i, j: integer;
const
crlf = #13#10; // carriage return/line feed
Procedure alborist;
begin
ComicURL := 'http://www.sergiobonellieditore.it/auto/alborist?collana=' + ComicSeries + '&numero=' + ComicNumber + '&subnum=0'; // Build item URL
Setfield(fieldURL, ComicURL); // Save variable URL to field URL
AnalyzePageAlborist(ComicURL); // Script hands over item URL and jumps to procedure AnalyzePageAlborist
end;
Procedure albo_speciale;
begin
ComicURL := 'http://www.sergiobonellieditore.it/auto/scheda_speciale?collana=' + ComicSeries + '&numero=' + ComicNumber + '&subnum=0'; // Build item URL
// showmessage ('URL ' + ComicURL + ' *');
Setfield(fieldURL, ComicURL); // Save variable URL to field URL
AnalyzePageScheda_speciale(ComicURL); // Script hands over item URL and jumps to procedure AnalyzePageScheda_speciale
end;
// ***** Analyze Item's Page *****
procedure AnalyzePageAlborist(URL: String); // Variable "URL" is handed over (former variable "ComicURL")
var
Page, SavePage, Value, saveValue: string; // Define variables "Page" and "Value"
begin
Page := GetPage(URL); // Fetch source code from website and store inside "Page"
SavePage := Page;
// Serie import
Value := ''; // Make sure "Value" is empty
Value := TextBetween(Page, '<title>Archivio arretrati: scheda dell''albo di ', '</title>'); // Extract title part from variable "Page"
HTMLDecode(Value); // Clean description from HTML codes (if some exist)
HTMLRemoveTags(Value); // Clean title from HTML tags (if some exist)
SetField(fieldMedia, Value); // Save title to field Label
// Picture import
Value := ''; // Make sure "Value" is empty
Value := TextBetween(Page, 'window.open(''', ''''); // Extract the picture URL from "Page"
if Value = '' then // If "Value" is still empty ( = no picture URL ) then..
Value := 'http://www.sergiobonellieditore.it' + TextBetween(Line, '<img src="', '"'); // .. try to extract URL for small picture instead
if Value <> '' then // If "Value" now contains picture URL then..
GetPicture(Value); // .. download and save picture
// Titolo tradotto
Value := '';
Value := TextBetween(Page, '<table border=0 cellspacing=0 cellpadding=0>', '</table>'); // Extract title part from variable "Page"
Value := TextBetween(Value, '<b>', '</b>'); // Extract exact title from variable "Value" now
// Value := StringReplace(Value, ''', ''''); // sistema gli apostofi
HTMLDecode(Value); // Clean description from HTML codes (if some exist)
HTMLRemoveTags(Value); // Clean title from HTML tags (if some exist)
Fulltrim(Value);
SetField(fieldTranslatedTitle, Value); // Save title to field TranslatedTitle
// Beschreibung / Description / Storia
// struttura dei primi numeri
Value := '';
saveValue := '';
// Storia
Value := TextBetween(Page, '<table width=100% cellspacing=0 cellpadding=0 border=0>', '</DIV>'); // Extract description part from variable "Page"
// showmessage('value1 ' + Value);
Value := TextBetween(Value, '<font face="Arial" size=2>', 'In questo numero:'); // Extract exact description from variable "Value" now
// showmessage('value2 ' + Value);
// Value := TextBetween(Value, '<font face="Arial" size=2>', '</font>'); // Extract exact description from variable "Value" now
HTMLDecode(Value); // Clean description from HTML codes (if some exist)
HTMLRemoveTags(Value);
FullTrim(Value); // Clean up the description
saveValue := Value;
// Comments / In questo numero
Value := TextBetween(Page, '<table width=100% cellspacing=0 cellpadding=0 border=0>', ' </td>'); // Extract description part from "Page"
// showmessage (Value)
Value := TextBetween(Value, 'In questo numero:', '</font>'); // Extract exact description from variable "Value" now
// showmessage (Value)
HTMLDecode(Value); // Clean description from HTML codes (if some exist)
HTMLRemoveTags(Value);
FullTrim(Value); // Clean up the description
if length(Value) > 0 then
SetField(fieldComments, ('In questo numero: ' + Value)); // Save description to field Description
// struttura dei numeri successivi (es. 214)
if length (saveValue) = 0 then
begin
Value := TextBetween(page, '<DIV VALIGN=TOP>', ' </td>'); // Extract description part from variable "Page"
// showmessage('value3 ' + Value);
Value := TextBetween(value, '<DIV VALIGN=TOP><font face="Arial" size=2>', '</font></DIV>'); // Extract description part from variable "Page"
HTMLDecode(Value); // Clean description from HTML codes (if some exist)
HTMLRemoveTags(Value);
FullTrim(Value); // Clean up the description
// showmessage('value4 ' + Value);
if length (Value) < 2 then // 2 as there must be crlf
showError ('Errore. collana ' + getfield(fieldMedia) + ' n.' + getfield(fieldOriginaltitle) + '. Trama mancante');
saveValue := Value;
end
SetField(fieldDescription, saveValue); // Save description to field Description
// showmessage ('descrizione ' + saveValue);
// Comments / In questo numero
Value := TextBetween(Page, '<table width=100% cellspacing=0 cellpadding=0 border=0>', ' </td>'); // Extract description part from "Page"
// showmessage (Value)
Value := TextBetween(Value, 'In questo numero:', '</font>'); // Extract exact description from variable "Value" now
// showmessage (Value)
HTMLDecode(Value); // Clean description from HTML codes (if some exist)
HTMLRemoveTags(Value);
FullTrim(Value); // Clean up the description
if length(Value) > 0 then
SetField(fieldComments, ('In questo numero: ' + Value)); // Save description to field Description
// fieldActors / Autori
SaveValue := '';
Value := '';
Value := TextBetween(Page, 'Soggetto e sceneggiatura: <b>', '</b>'); // Extract part from variable "Page"
HTMLDecode(Value); // Clean description from HTML codes (if some exist)
HTMLRemoveTags(Value);
FullTrim(Value); // Clean up the description
if length(Value) > 0 then
begin
saveValue := 'Soggetto e sceneggiatura: ' + Value + crlf;
end
Value := '';
Value := TextBetween(Page, 'Disegni e copertina: <b>', '</b>'); // Extract part from variable "Page"
HTMLDecode(Value); // Clean description from HTML codes (if some exist)
HTMLRemoveTags(Value);
FullTrim(Value); // Clean up the description
if length(Value) > 0 then
begin
saveValue := saveValue + 'Disegni e copertina: ' + Value + crlf;
end
Value := '';
Value := TextBetween(Page, 'Disegni: <b>', '</b>'); // Extract part from variable "Page"
HTMLDecode(Value); // Clean description from HTML codes (if some exist)
HTMLRemoveTags(Value);
FullTrim(Value); // Clean up the description
if length(Value) > 0 then
begin
saveValue := saveValue + 'Disegni: ' + Value + crlf;
end
Value := '';
Value := TextBetween(Page, 'Copertina: <b>', '</b>'); // Extract part from variable "Page"
HTMLDecode(Value); // Clean description from HTML codes (if some exist)
HTMLRemoveTags(Value);
FullTrim(Value); // Clean up the description
if length(Value) > 0 then
begin
saveValue := saveValue + 'Copertina: ' + Value + crlf;
end
SetField(fieldActors, saveValue); // Save description to field Actors
end; // *********************** End of procedure "AnalyzePageAlborist" *****************************************
procedure AnalyzePageScheda_speciale(URL: String); // Variable "URL" is handed over (former variable "ComicURL")
var
CharCut, Charlength: integer;
Page, SavePage, Value, saveValue: string; // Define variables "Page" and "Value"
StartDelimiter, EndDelimiter: String;
begin
Page := GetPage(ComicURL); // Fetch source code from website and store inside "Page"
SavePage := Page;
// Picture import
Value := ''; // Make sure "Value" is empty
Value := TextBetween(Page, 'window.open(''', ''''); // Extract the picture URL from "Page"
if Value = '' then // If "Value" is still empty ( = no picture URL ) then..
Value := 'http://www.sergiobonellieditore.it' + TextBetween(Value, '<img src="', '"'); // .. try to extract URL for small picture instead
if Value <> '' then // If "Value" now contains picture URL then..
GetPicture(Value); // .. download and save picture
// Serie import
Value := ''; // Make sure "Value" is empty
Value := TextBetween(Page, '<table border=0 cellspacing=0 cellpadding=0>', '</table'); // Extract serie from variable "Page"
SaveValue := Value; // SaveValue contiene tutta la table (meno i delimiters)
Showmessage ('savevalue1 ' + savevalue + ' ****');
StartDelimiter := '<font face="Arial" size=2>';
CharCut := Pos(StartDelimiter, Value);
EndDelimiter := '</font>';
Value := TextBetween(Value, StartDelimiter, EndDelimiter);
CharCut := CharCut + length(StartDelimiter) + length(Value) + length(EndDelimiter);
// showmessage ('Charcut * ' + IntToStr(CharCut) + ' *');
Delete(SaveValue, 1, Charcut); // stringa in cui cercare il prossimo campo
// Showmessage ('savevalue2 ' + savevalue + ' ****');
HTMLDecode(Value); // Clean description from HTML codes (if some exist)
HTMLRemoveTags(Value); // Clean title from HTML tags (if some exist)
Fulltrim(Value);
SetField(fieldMedia, Value); // Save title to field Media
// Titolo tradotto
Value := SaveValue;
Value := TextBetween(Value, '<font face="Arial" size=2>', '</font>'); // Extract exact title from variable "SaveValue"
HTMLDecode(Value); // Clean description from HTML codes (if some exist)
HTMLRemoveTags(Value); // Clean title from HTML tags (if some exist)
HTMLDecode(Value); // Clean description from HTML codes (if some exist)
FullTrim(Value);
showmessage ('Value titolo *' + Value + '***');
SetField(fieldTranslatedTitle, Value); // Save title to field TranslatedTitle
// Beschreibung / Description / Storia
// struttura dei primi numeri
Value := '';
saveValue := '';
// Storia
Value := TextBetween(Page, '<table width=100% cellspacing=0 cellpadding=0 border=0>', '</DIV>'); // Extract description part from variable "Page"
// showmessage('value1 ' + Value);
Value := TextBetween(Value, '<font face="Arial" size=2>', 'In questo numero:'); // Extract exact description from variable "Value" now
// showmessage('value2 ' + Value);
// Value := TextBetween(Value, '<font face="Arial" size=2>', '</font>'); // Extract exact description from variable "Value" now
HTMLDecode(Value); // Clean description from HTML codes (if some exist)
HTMLRemoveTags(Value);
FullTrim(Value); // Clean up the description
saveValue := Value;
// Comments / In questo numero
Value := TextBetween(Page, '<td width="50%" valign="bottom" ><font color="#0080C0" face="Verdana" size=1>', ' </td>'); // Extract description part from "Page"
// showmessage (Value)
Value := TextBetween(Value, '<strong>', '</strong>'); // Extract exact description from variable "Value" now
// showmessage (Value)
HTMLDecode(Value); // Clean description from HTML codes (if some exist)
HTMLRemoveTags(Value);
Fulltrim(Value);
if length(Value) > 0 then
SetField(fieldComments, ('In questo numero: ' + Value)); // Save description to field Description
// struttura dei numeri successivi (es. 214)
if length (saveValue) = 0 then
begin
Value := TextBetween(page, '<DIV VALIGN=TOP>', ' </td>'); // Extract description part from variable "Page"
// showmessage('value3 ' + Value);
Value := TextBetween(value, '<DIV VALIGN=TOP><font face="Arial" size=2>', '</font></DIV>'); // Extract description part from variable "Page"
HTMLDecode(Value); // Clean description from HTML codes (if some exist)
HTMLRemoveTags(Value);
FullTrim(Value); // Clean up the description
// showmessage('value4 ' + Value);
if length (Value) < 2 then // 2 as there must be crlf
showError ('Errore. collana ' + getfield(fieldMedia) + ' n.' + getfield(fieldOriginaltitle) + '. Trama mancante');
saveValue := Value;
end
Fulltrim(Value);
SetField(fieldDescription, saveValue); // Save description to field Description
// showmessage ('descrizione ' + saveValue);
// Comments / In questo numero
Value := TextBetween(Page, '<table width=100% cellspacing=0 cellpadding=0 border=0>', ' </td>'); // Extract description part from "Page"
// showmessage (Value)
Value := TextBetween(Value, 'In questo numero:', '</font>'); // Extract exact description from variable "Value" now
// showmessage (Value)
HTMLDecode(Value); // Clean description from HTML codes (if some exist)
HTMLRemoveTags(Value);
FullTrim(Value); // Clean up the description
if length(Value) > 0 then
SetField(fieldComments, ('In questo numero: ' + Value)); // Save description to field Description
// fieldActors / Autori
SaveValue := '';
Value := '';
Value := TextBetween(Page, 'Soggetto e sceneggiatura: <b>', '</b>'); // Extract part from variable "Page"
HTMLDecode(Value); // Clean description from HTML codes (if some exist)
HTMLRemoveTags(Value);
FullTrim(Value); // Clean up the description
if length(Value) > 0 then
begin
saveValue := 'Soggetto e sceneggiatura: ' + Value + crlf;
end
Value := '';
Value := TextBetween(Page, 'Soggetto: <b>', '</b>'); // Extract part from variable "Page"
HTMLDecode(Value); // Clean description from HTML codes (if some exist)
HTMLRemoveTags(Value);
FullTrim(Value); // Clean up the description
if length(Value) > 0 then
begin
saveValue := 'Soggetto: ' + Value + crlf;
end
Value := '';
Value := TextBetween(Page, 'Sceneggiatura: <b>', '</b>'); // Extract part from variable "Page"
HTMLDecode(Value); // Clean description from HTML codes (if some exist)
HTMLRemoveTags(Value);
FullTrim(Value); // Clean up the description
if length(Value) > 0 then
begin
saveValue := 'Sceneggiatura: ' + Value + crlf;
end
Value := '';
Value := TextBetween(Page, 'Disegni e copertina: <b>', '</b>'); // Extract part from variable "Page"
HTMLDecode(Value); // Clean description from HTML codes (if some exist)
HTMLRemoveTags(Value);
FullTrim(Value); // Clean up the description
if length(Value) > 0 then
begin
saveValue := saveValue + 'Disegni e copertina: ' + Value + crlf;
end
Value := '';
Value := TextBetween(Page, 'Disegni: <b>', '</b>'); // Extract part from variable "Page"
HTMLDecode(Value); // Clean description from HTML codes (if some exist)
HTMLRemoveTags(Value);
FullTrim(Value); // Clean up the description
if length(Value) > 0 then
begin
saveValue := saveValue + 'Disegni: ' + Value + crlf;
end
Value := '';
Value := TextBetween(Page, 'Copertina: <b>', '</b>'); // Extract part from variable "Page"
HTMLDecode(Value); // Clean description from HTML codes (if some exist)
HTMLRemoveTags(Value);
FullTrim(Value); // Clean up the description
if length(Value) > 0 then
begin
saveValue := saveValue + 'Copertina: ' + Value + crlf;
end
SetField(fieldActors, saveValue); // Save description to field Actors
end; // *********************** End of procedure "AnalyzeScheda_speciale" *****************************************
Procedure Menu;
begin
Repeat
sw_serie := 'OK';
case ComicSeries of
'Tex': ComicSeries := '1'; '1': ComicSeries := '1';
'Almanacco del West': ComicSeries := '2'; '2': ComicSeries := '2';
'Julia': ComicSeries := '4'; '4': ComicSeries := '4';
'Almanacco del West': ComicSeries := '7'; '7': ComicSeries := '7';
'Martin Mystère': ComicSeries := '13'; '13': ComicSeries := '13';
'Nathan Never': ComicSeries := '15'; '15': ComicSeries := '15';
'Dylan Dog': ComicSeries := '18'; '18': ComicSeries := '18';
'Almanacco dell''avventura': ComicSeries := '25'; '25': ComicSeries := '25';
'Almanacco della Fantascienza': ComicSeries := '34'; '34': ComicSeries := '34';
'Almanacco della Paura': ComicSeries := '36'; '34': ComicSeries := '36';
'Almanacco dell''avventura': ComicSeries := '50'; '50': ComicSeries := '50';
'Almanacco del Giallo': ComicSeries := '70'; '70': ComicSeries := '70';
else
begin
PickTreeClear;
PickTreeAdd(' (1) Tex', '1');
PickTreeAdd(' (2) Almanacco del West', '2');
PickTreeAdd(' (4) Julia', '4');
PickTreeAdd(' (7) Almanacco del West (Tex)', '7');
PickTreeAdd('(13) Martin Mystère', '13');
PickTreeAdd('(15) Nathan Never', '15');
PickTreeAdd('(18) Dylan Dog', '18');
PickTreeAdd('(25) Almanacco dell''Avventura (Zagor)', '25');
PickTreeAdd('(34) Almanacco della Fantascienza', '34');
PickTreeAdd('(36) Almanacco della Paura', '36');
PickTreeAdd('(50) Almanacco dell''Avventura (Mister No)', '50');
PickTreeAdd('(70) Almanacco del Giallo (Julia)', '70');
if PickTreeExec(ComicSeries) then
ShowMessage('Series number is: ' + ComicSeries);
sw_serie := 'error'
end;
end;
until sw_serie = 'OK';
end;
// ***** Beginning of the script *****
begin
if CheckVersion(3,5,0) then // Checks if Ant Movie Catalog version is 3.5.0 or higher
begin
// Input('www.sergiobonellieditore.it', 'Enter comic series:', ComicSeries); // Asks for comic series number
ComicSeries := GetField(fieldMedia);
showmessage ('trace1');
// if ComicSeries = '' then
// begin
// showmessage ('trace2');
menu;
// end;
showmessage ('trace3');
ComicNumber := GetField(fieldOriginalTitle);
if ComicNumber = '' then
Input('www.sergiobonellieditore.it', ComicSeries + crlf + 'Enter comic number:', ComicNumber);
If (ComicSeries = '1') or (comicSeries = '13') or (ComicSeries = '15') then
begin
ComicURL := 'http://www.sergiobonellieditore.it/auto/alborist?collana=' + ComicSeries + '&numero=' + ComicNumber + '&subnum=0'; // Build item URL
Setfield(fieldURL, ComicURL); // Save variable URL to field URL
AnalyzePageAlborist(ComicURL); // Script hands over item URL and jumps to procedure AnalyzePageAlborist
end
If (ComicSeries = '2') or (comicSeries = '7') or (ComicSeries = '8') or (ComicSeries = '70') then
begin
ComicURL := 'http://www.sergiobonellieditore.it/auto/scheda_speciale?collana=' + ComicSeries + '&numero=' + ComicNumber + '&subnum=0'; // Build item URL
// showmessage ('URL ' + ComicURL + ' *');
Setfield(fieldURL, ComicURL); // Save variable URL to field URL
AnalyzePageScheda_speciale(ComicURL); // Script hands over item URL and jumps to procedure AnalyzePageScheda_speciale
// Input('www.sergiobonellieditore.it', 'Enter comic number:', ComicNumber); // Asks for comic item number
// ComicNumber := ComicSeries
end
end
else
ShowMessage('This script requires a newer version of Ant Movie Catalog (at least the version 3.5.0)');
// If Checkversion fails end.
end.
Code: Select all
case ComicSeries of
'Tex': ComicSeries := '1'; '1': ComicSeries := '1';
'Almanacco del West': ComicSeries := '2'; '2': ComicSeries := '2';
'Julia': ComicSeries := '4'; '4': ComicSeries := '4';
Code: Select all
case ComicSeries of
'Tex','1': ComicSeries := '1';
'Almanacco del West','2': ComicSeries := '2';
'Julia','4': ComicSeries := '4';
Code: Select all
function MyTrim(Value: string):string;
begin
result := '';
repeat
if (copy(Value, 1, 1) = ' ') or (copy(Value, 1, 1) = #10) or (copy(Value, 1, 1) = #13) or (copy(Value, 1, 1) = #9) then
Value := copy(Value, 2, Length(Value)-1);
until
(copy(Value, 1, 1) <> ' ') and (copy(Value, 1, 1) <> #10) and (copy(Value, 1, 1) <> #13) and (copy(Value, 1, 1) <> #9);
repeat
if (copy(Value, Length(Value), 1) = ' ') or (copy(Value, Length(Value), 1) = #10) or (copy(Value, Length(Value), 1) = #13) or (copy(Value, Length(Value), 1) = #9) then
Value := copy(Value, 1, Length(Value)-2);
until
(copy(Value, Length(Value), 1) <> ' ') and (copy(Value, Length(Value), 1) <> #10) and (copy(Value, Length(Value), 1) <> #13) and (copy(Value, Length(Value), 1) <> #9);
result := Value;
end;
Code: Select all
Value := MyTrim(Value);
Code: Select all
MyTrim(Value);
Code: Select all
function MyTrim(Value: string):string;
var
ExitLoop: Boolean;
begin
Result := '';
ExitLoop := False;
repeat
case copy(Value, 1, 1) of
' ', #9, #10, #13: Value := copy(Value, 2, Length(Value)-1);
else
ExitLoop := True;
end;
until ExitLoop;
ExitLoop := False;
repeat
case copy(Value, Length(Value), 1) of
' ', #9, #10, #13: Value := copy(Value, 1, Length(Value)-2);
else
ExitLoop := True;
end;
until ExitLoop;
Result := Value;
end;
Thanks, I will replace it.bad4u wrote:@antp: This might be a more elegant solution for StringUtils1; it doesn't break on empty strings, too
antp wrote:you did not change the version number nor the date, is it on purpose or did you forget?
Code: Select all
Value := Fulltrim(Value);
bad4u wrote:
Code: Select all
program sergiobonellieditore;
uses
StringUtils1; // Script needs external unit StringUtils1.pas in scripts folder !
var
ComicURL, ComicSeries, ComicNumber, Collana: string; // Define some script variables
update: string;
Titolo_e_Periodicita: string;
sw_serie, StartDelimiter, endDelimiter : string;
numCollana : integer;
CharCut: integer;
DataPubbl,Mese_Pubblicazione: String;
// i, j: integer;
const
crlf = #13#10; // carriage return/line feed
Procedure alborist;
begin
ComicURL := 'http://www.sergiobonellieditore.it/auto/alborist?collana=' + ComicSeries + '&numero=' + ComicNumber + '&subnum=0'; // Build item URL
Setfield(fieldURL, ComicURL); // Save variable URL to field URL
AnalyzePageAlborist(ComicURL); // Script hands over item URL and jumps to procedure AnalyzePageAlborist
end;
Procedure albo_speciale;
begin
ComicURL := 'http://www.sergiobonellieditore.it/auto/scheda_speciale?collana=' + ComicSeries + '&numero=' + ComicNumber + '&subnum=0'; // Build item URL
// showmessage ('URL ' + ComicURL + ' *');
Setfield(fieldURL, ComicURL); // Save variable URL to field URL
AnalyzePageScheda_speciale(ComicURL); // Script hands over item URL and jumps to procedure AnalyzePageScheda_speciale
end;
// ***** Analyze Item's Page *****
procedure AnalyzePageAlborist(URL: String); // Variable "URL" is handed over (former variable "ComicURL")
var
Page, SavePage, Value, saveValue: string; // Define variables "Page" and "Value"
begin
Page := GetPage(URL); // Fetch source code from website and store inside "Page"
SavePage := Page;
// Serie import
Value := ''; // Make sure "Value" is empty
Value := TextBetween(Page, '<title>Archivio arretrati: scheda dell''albo di ', '</title>'); // Extract title part from variable "Page"
HTMLDecode(Value); // Clean description from HTML codes (if some exist)
HTMLRemoveTags(Value); // Clean title from HTML tags (if some exist)
Value := FullTrim (Value);
SetField(fieldSource, Value); // Save title to field Label
// Picture import
Value := ''; // Make sure "Value" is empty
Value := TextBetween(Page, 'window.open(''', ''''); // Extract the picture URL from "Page"
if Value = '' then // If "Value" is still empty ( = no picture URL ) then..
Value := 'http://www.sergiobonellieditore.it' + TextBetween(Line, '<img src="', '"'); // .. try to extract URL for small picture instead
if Value <> '' then // If "Value" now contains picture URL then..
GetPicture(Value); // .. download and save picture
// Titolo tradotto
Value := '';
Value := TextBetween(Page, '<table border=0 cellspacing=0 cellpadding=0>', '</table>'); // Extract title part from variable "Page"
Titolo_e_Periodicita := Value;
Value := TextBetween(Value, '<b>', '</b>'); // Extract exact title from variable "Value" now
HTMLDecode(Value); // Clean description from HTML codes (if some exist)
HTMLRemoveTags(Value); // Clean title from HTML tags (if some exist)
// showmessage ('titolo *' + value + '*');
FullTrim (Value);
// Value := StringReplace(Value, '’', '''');
SetField(fieldTranslatedTitle, Value); // Save title to field TranslatedTitle
// Beschreibung / Description / Storia
// struttura dei primi numeri
Value := '';
saveValue := '';
// Storia
Value := TextBetween(Page, '<table width=100% cellspacing=0 cellpadding=0 border=0>', '</DIV>'); // Extract description part from variable "Page"
// showmessage('value1 ' + Value);
Value := TextBetween(Value, '<font face="Arial" size=2>', 'In questo numero:'); // Extract exact description from variable "Value" now
// showmessage('value2 ' + Value);
// Value := TextBetween(Value, '<font face="Arial" size=2>', '</font>'); // Extract exact description from variable "Value" now
HTMLDecode(Value); // Clean description from HTML codes (if some exist)
HTMLRemoveTags(Value);
Value := FullTrim (Value); // Clean up the description
saveValue := Value;
// ***************** inizio periodicità
StartDelimiter := '<font face="Arial" size=2>';
CharCut := Pos(StartDelimiter, Value);
EndDelimiter := '</font>';
Value := TextBetween(Page, StartDelimiter, EndDelimiter);
// showmessage ('periodicità estratta * ' + Value + ' *');
CharCut := CharCut + length(StartDelimiter) + length(Value) + length(EndDelimiter);
// showmessage ('Charcut * ' + IntToStr(CharCut) + ' *');
Delete(SaveValue, 1, Charcut); // stringa in cui cercare il prossimo campo
// Showmessage ('savevalue2 ' + savevalue + ' ****');
HTMLDecode(Value); // Clean description from HTML codes (if some exist)
HTMLRemoveTags(Value); // Clean title from HTML tags (if some exist)
Value := FullTrim (Value);
// DataPubbl := Value + '</font>'; //serie 18: contiene titolo + 'mensile' e ripristino fine delimiter
// showmessage ('DataPubbl *' + DataPubbl + '*'); //OK per serie 18
Mese_Pubblicazione := ''; // pulisco Mese_Pubblicazione
Mese_Pubblicazione := TextBetween(Page, '<font face="Verdana" size="1" color="#FFFFFF">', '</font>');
HTMLDecode(Mese_Pubblicazione); // Clean description from HTML codes (if some exist)
HTMLRemoveTags(Mese_Pubblicazione); // Clean title from HTML tags (if some exist)
Mese_Pubblicazione := FullTrim (Mese_Pubblicazione);
Value := Mese_Pubblicazione;
// showmessage ('lunghezza *' + Mese_Pubblicazione + '*' + Inttostr(Length(Mese_pubblicazione)));
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
if ComicSeries = '18' then
begin
Value := TextBetween(Titolo_e_Periodicita, ',', '<br>');
HTMLDecode(Value); // Clean description from HTML codes (if some exist)
HTMLRemoveTags(Value); // Clean title from HTML tags (if some exist)
Value := FullTrim (Value);
if Mese_pubblicazione <> '' then
Value := Mese_pubblicazione + ' - ' + Value;
end
if ComicSeries = '13' then
begin
Value := TextBetween(Titolo_e_Periodicita, ',', '<br>');
HTMLDecode(Value); // Clean description from HTML codes (if some exist)
HTMLRemoveTags(Value); // Clean title from HTML tags (if some exist)
Value := FullTrim (Value);
if Mese_pubblicazione <> '' then
Value := Mese_pubblicazione + ' - ' + Value;
end
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
SetField(fieldDirector, Value); // Save data pubblicazione to Field Director
// ***************** fine periodicità
// Comments / In questo numero
Value := TextBetween(Page, '<table width=100% cellspacing=0 cellpadding=0 border=0>', ' </td>'); // Extract description part from "Page"
// showmessage (Value)
Value := TextBetween(Value, 'In questo numero:', '</font>'); // Extract exact description from variable "Value" now
// showmessage (Value)
HTMLDecode(Value); // Clean description from HTML codes (if some exist)
HTMLRemoveTags(Value);
Value := FullTrim (Value); // Clean up the description
if length(Value) > 0 then
SetField(fieldComments, ('In questo numero: ' + Value)); // Save description to field Description
// struttura dei numeri successivi (es. 214)
if length (saveValue) = 0 then
begin
Value := TextBetween(page, '<DIV VALIGN=TOP>', ' </td>'); // Extract description part from variable "Page"
// showmessage('value3 ' + Value);
Value := TextBetween(value, '<DIV VALIGN=TOP><font face="Arial" size=2>', '</font></DIV>'); // Extract description part from variable "Page"
HTMLDecode(Value); // Clean description from HTML codes (if some exist)
HTMLRemoveTags(Value);
Value := FullTrim (Value); // Clean up the description
// showmessage('value4 ' + Value);
if length (Value) < 2 then // 2 as there must be crlf
showError ('Errore. collana ' + getfield(fieldMedia) + ' n.' + getfield(fieldOriginaltitle) + '. Trama mancante');
saveValue := Value;
end
SetField(fieldDescription, saveValue); // Save description to field Description
// showmessage ('descrizione ' + saveValue);
// Comments / In questo numero
Value := TextBetween(Page, '<table width=100% cellspacing=0 cellpadding=0 border=0>', ' </td>'); // Extract description part from "Page"
// showmessage (Value)
Value := TextBetween(Value, 'In questo numero:', '</font>'); // Extract exact description from variable "Value" now
// showmessage (Value)
HTMLDecode(Value); // Clean description from HTML codes (if some exist)
HTMLRemoveTags(Value);
Value := FullTrim (Value); // Clean up the description
if length(Value) > 0 then
SetField(fieldComments, ('In questo numero: ' + Value)); // Save description to field Description
// fieldActors / Autori
SaveValue := '';
Value := '';
Value := TextBetween(Page, 'Soggetto e sceneggiatura: <b>', '</b>'); // Extract part from variable "Page"
HTMLDecode(Value); // Clean description from HTML codes (if some exist)
HTMLRemoveTags(Value);
Value := FullTrim (Value); // Clean up the description
if length(Value) > 0 then
begin
saveValue := 'Soggetto e sceneggiatura: ' + Value + crlf;
end
Value := '';
Value := TextBetween(Page, 'Disegni e copertina: <b>', '</b>'); // Extract part from variable "Page"
HTMLDecode(Value); // Clean description from HTML codes (if some exist)
HTMLRemoveTags(Value);
Value := FullTrim (Value); // Clean up the description
if length(Value) > 0 then
begin
saveValue := saveValue + 'Disegni e copertina: ' + Value + crlf;
end
Value := '';
Value := TextBetween(Page, 'Disegni: <b>', '</b>'); // Extract part from variable "Page"
HTMLDecode(Value); // Clean description from HTML codes (if some exist)
HTMLRemoveTags(Value);
Value := FullTrim (Value); // Clean up the description
if length(Value) > 0 then
begin
saveValue := saveValue + 'Disegni: ' + Value + crlf;
end
Value := '';
Value := TextBetween(Page, 'Copertina: <b>', '</b>'); // Extract part from variable "Page"
HTMLDecode(Value); // Clean description from HTML codes (if some exist)
HTMLRemoveTags(Value);
Value := FullTrim (Value); // Clean up the description
if length(Value) > 0 then
begin
saveValue := saveValue + 'Copertina: ' + Value + crlf;
end
SetField(fieldActors, saveValue); // Save description to field Actors
end; // *********************** End of procedure "AnalyzePageAlborist" *****************************************
procedure AnalyzePageScheda_speciale(URL: String); // Variable "URL" is handed over (former variable "ComicURL")
var
Page, SavePage, Value, saveValue: string; // Define variables "Page" and "Value"
begin
Page := GetPage(ComicURL); // Fetch source code from website and store inside "Page"
SavePage := Page;
// Picture import
Value := ''; // Make sure "Value" is empty
Value := TextBetween(Page, 'window.open(''', ''''); // Extract the picture URL from "Page"
if Value = '' then // If "Value" is still empty ( = no picture URL ) then..
Value := 'http://www.sergiobonellieditore.it' + TextBetween(Value, '<img src="', '"'); // .. try to extract URL for small picture instead
if Value <> '' then // If "Value" now contains picture URL then..
GetPicture(Value); // .. download and save picture
// Serie import
Value := ''; // Make sure "Value" is empty
Value := TextBetween(Page, '<table border=0 cellspacing=0 cellpadding=0>', '</table'); // Extract serie from variable "Page"
SaveValue := Value; // SaveValue contiene tutta la table (meno i delimiters)
Titolo_e_Periodicita := Value;
// ***************** inizio periodicità
StartDelimiter := '<font face="Arial" size=2>';
CharCut := Pos(StartDelimiter, Value);
EndDelimiter := '</font>';
Value := TextBetween(Value, StartDelimiter, EndDelimiter);
CharCut := CharCut + length(StartDelimiter) + length(Value) + length(EndDelimiter);
// showmessage ('Charcut * ' + IntToStr(CharCut) + ' *');
Delete(SaveValue, 1, Charcut); // stringa in cui cercare il prossimo campo
// Showmessage ('savevalue2 ' + savevalue + ' ****');
HTMLDecode(Value); // Clean description from HTML codes (if some exist)
HTMLRemoveTags(Value); // Clean title from HTML tags (if some exist)
Value := FullTrim (Value);
DataPubbl := Value + '</font>'; //serie 18: contiene titolo + 'periodicità irregolare' e ripristino fine delimiter
// showmessage ('DataPubbl *' + DataPubbl + '*'); //OK per serie 18
Mese_Pubblicazione := ''; // pulisco Mese_Pubblicazione
Mese_Pubblicazione := TextBetween(Page, '<font face="Verdana" size="1" color="#FFFFFF">', '</font></strong>');
HTMLDecode(Mese_Pubblicazione); // Clean description from HTML codes (if some exist)
HTMLRemoveTags(Mese_Pubblicazione); // Clean title from HTML tags (if some exist)
Mese_Pubblicazione := FullTrim (Mese_Pubblicazione);
// showmessage ('lunghezza *' + Mese_Pubblicazione + '*' + Inttostr(Length(Mese_pubblicazione)));
// if (ComicSeries = '15') then
// begin
// CharCut := Pos(' n.', Mese_Pubblicazione);
// Value := copy(Mese_Pubblicazione, 0, CharCut-1); // Extract exact periodicity from variable "Value"
// Value := TextBetween(DataPubbl, ',', '</font>');
// HTMLDecode(Value); // Clean description from HTML codes (if some exist)
// HTMLRemoveTags(Value); // Clean title from HTML tags (if some exist)
// Value := FullTrim (Value);
// showmessage ('Mese *' + Value + '*');
// if Mese_pubblicazione <> '' then
// Value := Mese_pubblicazione + ' - ' + Value;
// end
if ComicSeries = '15' then
begin
Value := TextBetween(Titolo_e_Periodicita, ',</font>', '<br>');
showmessage ('Titolo e periodicita *' + Titolo_e_Periodicita + '*');
showmessage ('Mesea *' + Value + '*');
HTMLDecode(Value); // Clean description from HTML codes (if some exist)
showmessage ('Meseb *' + Value + '*');
HTMLRemoveTags(Value); // Clean title from HTML tags (if some exist)
showmessage ('Mesebc*' + Value + '*');
Value := FullTrim (Value);
showmessage ('Mesed *' + Value + '*');
if Value = 'mensil' then
Value := 'mensile';
if Mese_pubblicazione <> '' then
Value := Mese_pubblicazione + ' - ' + Value;
end
if (ComicSeries = '28') then
begin
Value := 'Maxi Tex';
SetField(fieldSource, Value); // Save serie to field Source
end
if (ComicSeries = '70') then
begin
Value := 'Almanacco del Giallo (Julia)';
SetField(fieldSource, Value); // Save serie to field Source
end
if (ComicSeries = '28') or (ComicSeries = '70') then
begin
Value := TextBetween(DataPubbl, ',', '</font>');
HTMLDecode(Value); // Clean description from HTML codes (if some exist)
HTMLRemoveTags(Value); // Clean title from HTML tags (if some exist)
Value := FullTrim (Value);
// showmessage ('Mese *' + Value + '*');
if Mese_pubblicazione <> '' then
Value := Mese_pubblicazione + ' - ' + Value;
end
SetField(fieldDirector, Value); // Save periodicità to field Director
// ***************** fine periodicità
// Titolo tradotto
Value := SaveValue;
Value := TextBetween(Value, '<font face="Arial" size=2>', '</font>'); // Extract exact title from variable "SaveValue"
HTMLDecode(Value); // Clean description from HTML codes (if some exist)
HTMLRemoveTags(Value); // Clean title from HTML tags (if some exist)
Value := FullTrim (Value);
// showmessage ('Value titolo *' + Value + '***');
SetField(fieldTranslatedTitle, Value); // Save title to field TranslatedTitle
// Beschreibung / Description / Storia
// struttura dei primi numeri
Value := '';
saveValue := '';
// Storia
Value := TextBetween(Page, '<table width=100% cellspacing=0 cellpadding=0 border=0>', '</DIV>'); // Extract description part from variable "Page"
// showmessage('value1 ' + Value);
Value := TextBetween(Value, '<font face="Arial" size=2>', 'In questo numero:'); // Extract exact description from variable "Value" now
// showmessage('value2 ' + Value);
// Value := TextBetween(Value, '<font face="Arial" size=2>', '</font>'); // Extract exact description from variable "Value" now
HTMLDecode(Value); // Clean description from HTML codes (if some exist)
HTMLRemoveTags(Value);
Value := FullTrim (Value); // Clean up the description
saveValue := Value;
// Comments / In questo numero
Value := TextBetween(Page, '<td width="50%" valign="bottom" ><font color="#0080C0" face="Verdana" size=1>', ' </td>'); // Extract description part from "Page"
// showmessage (Value)
Value := TextBetween(Value, '<strong>', '</strong>'); // Extract exact description from variable "Value" now
// showmessage (Value)
HTMLDecode(Value); // Clean description from HTML codes (if some exist)
HTMLRemoveTags(Value);
Value := FullTrim (Value);
if length(Value) > 0 then
SetField(fieldComments, ('In questo numero: ' + Value)); // Save description to field Description
// struttura dei numeri successivi (es. 214)
if length (saveValue) = 0 then
begin
Value := TextBetween(page, '<DIV VALIGN=TOP>', ' </td>'); // Extract description part from variable "Page"
// showmessage('value3 ' + Value);
Value := TextBetween(value, '<DIV VALIGN=TOP><font face="Arial" size=2>', '</font></DIV>'); // Extract description part from variable "Page"
HTMLDecode(Value); // Clean description from HTML codes (if some exist)
HTMLRemoveTags(Value);
Value := FullTrim (Value); // Clean up the description
// showmessage('value4 ' + Value);
if length (Value) < 2 then // 2 as there must be crlf
showError ('Errore. collana ' + getfield(fieldMedia) + ' n.' + getfield(fieldOriginaltitle) + '. Trama mancante');
saveValue := Value;
end
Value := FullTrim (Value);
SetField(fieldDescription, saveValue); // Save description to field Description
// showmessage ('descrizione ' + saveValue);
// Comments / In questo numero
Value := TextBetween(Page, '<table width=100% cellspacing=0 cellpadding=0 border=0>', ' </td>'); // Extract description part from "Page"
// showmessage (Value)
Value := TextBetween(Value, 'In questo numero:', '</font>'); // Extract exact description from variable "Value" now
// showmessage (Value)
HTMLDecode(Value); // Clean description from HTML codes (if some exist)
HTMLRemoveTags(Value);
Value := FullTrim (Value); // Clean up the description
if length(Value) > 0 then
SetField(fieldComments, ('In questo numero: ' + Value)); // Save description to field Description
// fieldActors / Autori
SaveValue := '';
Value := '';
Value := TextBetween(Page, 'Soggetto e sceneggiatura: <b>', '</b>'); // Extract part from variable "Page"
HTMLDecode(Value); // Clean description from HTML codes (if some exist)
HTMLRemoveTags(Value);
Value := FullTrim (Value); // Clean up the description
if length(Value) > 0 then
begin
saveValue := 'Soggetto e sceneggiatura: ' + Value + crlf;
end
Value := '';
Value := TextBetween(Page, 'Soggetto: <b>', '</b>'); // Extract part from variable "Page"
HTMLDecode(Value); // Clean description from HTML codes (if some exist)
HTMLRemoveTags(Value);
Value := FullTrim (Value); // Clean up the description
if length(Value) > 0 then
begin
saveValue := 'Soggetto: ' + Value + crlf;
end
Value := '';
Value := TextBetween(Page, 'Sceneggiatura: <b>', '</b>'); // Extract part from variable "Page"
HTMLDecode(Value); // Clean description from HTML codes (if some exist)
HTMLRemoveTags(Value);
Value := FullTrim (Value); // Clean up the description
if length(Value) > 0 then
begin
saveValue := 'Sceneggiatura: ' + Value + crlf;
end
Value := '';
Value := TextBetween(Page, 'Disegni e copertina: <b>', '</b>'); // Extract part from variable "Page"
HTMLDecode(Value); // Clean description from HTML codes (if some exist)
HTMLRemoveTags(Value);
Value := FullTrim (Value); // Clean up the description
if length(Value) > 0 then
begin
saveValue := saveValue + 'Disegni e copertina: ' + Value + crlf;
end
Value := '';
Value := TextBetween(Page, 'Disegni: <b>', '</b>'); // Extract part from variable "Page"
HTMLDecode(Value); // Clean description from HTML codes (if some exist)
HTMLRemoveTags(Value);
Value := FullTrim (Value); // Clean up the description
if length(Value) > 0 then
begin
saveValue := saveValue + 'Disegni: ' + Value + crlf;
end
Value := '';
Value := TextBetween(Page, 'Copertina: <b>', '</b>'); // Extract part from variable "Page"
HTMLDecode(Value); // Clean description from HTML codes (if some exist)
HTMLRemoveTags(Value);
Value := FullTrim (Value); // Clean up the description
if length(Value) > 0 then
begin
saveValue := saveValue + 'Copertina: ' + Value + crlf;
end
SetField(fieldActors, saveValue); // Save description to field Actors
end; // *********************** End of procedure "AnalyzeScheda_speciale" *****************************************
Procedure Menu;
begin
Repeat
sw_serie := 'OK';
case ComicSeries of
'Tex', '1': ComicSeries := '1';
'Almanacco del West', '2': ComicSeries := '2';
'Julia', '4': ComicSeries := '4';
'Almanacco del West', '7': ComicSeries := '7';
'Zagor', '10': ComicSeries := '10';
'Martin Mystère', '13': ComicSeries := '13';
'Nathan Never', '15': ComicSeries := '15';
'Dylan Dog', '18': ComicSeries := '18';
'Almanacco dell''avventura', '25': ComicSeries := '25';
'Maxi Tex', '28': ComicSeries := '28';
'Almanacco della Fantascienza', '34': ComicSeries := '34';
'Almanacco della Paura', '36': ComicSeries := '36';
'Almanacco dell''avventura', '50': ComicSeries := '50';
'Almanacco del Giallo', '70': ComicSeries := '70';
else
begin
PickTreeClear;
PickTreeAdd(' (1) Tex', '1');
PickTreeAdd(' (2) Almanacco del West', '2');
PickTreeAdd(' (4) Julia', '4');
PickTreeAdd(' (7) Almanacco del West (Tex)', '7');
PickTreeAdd('(10) Zagor', '10');
PickTreeAdd('(13) Martin Mystère', '13');
PickTreeAdd('(15) Nathan Never', '15');
PickTreeAdd('(18) Dylan Dog', '18');
PickTreeAdd('(25) Almanacco dell''Avventura (Zagor)', '25');
PickTreeAdd('(28) Maxi Tex', '28');
PickTreeAdd('(34) Almanacco della Fantascienza', '34');
PickTreeAdd('(36) Almanacco della Paura', '36');
PickTreeAdd('(50) Almanacco dell''Avventura (Mister No)', '50');
PickTreeAdd('(70) Almanacco del Giallo (Julia)', '70');
if PickTreeExec(ComicSeries) then
ShowMessage('Series number is: ' + ComicSeries);
sw_serie := 'error'
end;
end;
until sw_serie = 'OK';
end;
// ***** Beginning of the script *****
begin
if CheckVersion(3,5,0) then // Checks if Ant Movie Catalog version is 3.5.0 or higher
begin
// Input('www.sergiobonellieditore.it', 'Enter comic series:', ComicSeries); // Asks for comic series number
ComicSeries := GetField(fieldMedia);
// if ComicSeries = '' then
// begin
// showmessage ('trace2');
menu;
// end;
ComicNumber := GetField(fieldOriginalTitle);
if ComicNumber = '' then
Input('www.sergiobonellieditore.it', ComicSeries + crlf + 'Enter comic number:', ComicNumber);
If (ComicSeries = '1') or (ComicSeries = '10')or (comicSeries = '13') or (ComicSeries = '18')
then
begin
ComicURL := 'http://www.sergiobonellieditore.it/auto/alborist?collana=' + ComicSeries + '&numero=' + ComicNumber + '&subnum=0'; // Build item URL
Setfield(fieldURL, ComicURL); // Save variable URL to field URL
AnalyzePageAlborist(ComicURL); // Script hands over item URL and jumps to procedure AnalyzePageAlborist
end
If (ComicSeries = '2') or (comicSeries = '7') or (ComicSeries = '8') or (ComicSeries = '15') or (ComicSeries = '70')
or (ComicSeries = '28') then
begin
ComicURL := 'http://www.sergiobonellieditore.it/auto/scheda_speciale?collana=' + ComicSeries + '&numero=' + ComicNumber + '&subnum=0'; // Build item URL
// showmessage ('URL ' + ComicURL + ' *');
Setfield(fieldURL, ComicURL); // Save variable URL to field URL
AnalyzePageScheda_speciale(ComicURL); // Script hands over item URL and jumps to procedure AnalyzePageScheda_speciale
// Input('www.sergiobonellieditore.it', 'Enter comic number:', ComicNumber); // Asks for comic item number
// ComicNumber := ComicSeries
end
end
else
ShowMessage('This script requires a newer version of Ant Movie Catalog (at least the version 3.5.0)');
// If Checkversion fails end.
end.
Code: Select all
Value := TextBetween(Titolo_e_Periodicita, ',</font>', '<br>');
FullTrim simply reads first character of a variable and checks if it is space (' '), tab (#9), or linebreak (#13#10) - as long as it finds one, it deletes this character. Same for the last character of the variable.fulvio53s03 wrote:Sorry, I need your help as I don't understand very well the function 'FullTrim'.
Code: Select all
showmessage ('Mesebc*' + Value + '*');
FullTrim (Value);
showmessage ('Mesed *' + Value + '*');
showmessage ('length Mesed *' + IntToStr(Length(Value)) + '*');
Value := FullTrim (Value);
showmessage ('Mesee *' + Value + '*');
showmessage ('length Mesee *' + IntToStr(Length(Value)) + '*');
Code: Select all
showmessage ('Mesebc*' + Value + '*');
Value := FullTrim (Value);
showmessage ('Mesed *' + Value + '*');
FullTrim(Value) always does the same - it calls the external function FullTrim from StringUtils1.pas and hands over variable Value. Now the function deletes the spaces, tabs and linebreaks and writes the result to variable Result (still within StringUtils1). After that you need to hand over the result (= variable Result) back to your variable Value ( Value := FullTrim(Value); ).. else the changes from FullTrim just get lost again ( FullTrim(Value); ).fulvio53s03 wrote:What is the difference in using:
Value := FullTrim(Value)
instead of:
Fulltrim(Value)
?
Can you suggest me a way to see the ascii (or ansi?) code of special characters extracted?
Code: Select all
showmessage ('Mesebc*' + Value + '*');
FullTrim (Value);
showmessage ('Mesed *' + Value + '*');
showmessage ('length Mesed *' + IntToStr(Length(Value)) + '*');
Value := FullTrim (Value);
showmessage ('Mesee *' + Value + '*');
showmessage ('length Mesee *' + IntToStr(Length(Value)) + '*');