Weiteres Feld in Standortbestimmung
Verfasst: Mi Okt 11, 2006 10:54 am
Hallo,
Ich wage mich nun auch in die Command Libary rein. Meine Anforderung ist ein weiteres Feld in der Standortbestimmung um verschiedene Gesellschaften anzugeben.
Eigentlich habe ich die Konfiguration mit den Auswahllisten bereits soweit geändert das ein weiteres Formularfeld hinzugefügt wurde. Wenn ich das Skript dann aktiviere übernimmt mir das Skript die eingefügten Gesellschaften nicht.
Ich habe das Script soweit angepasst das es ein neues %FORM3% hat und auch eine neue Project Variable %COMPANY%. Weiterhin habe ich den Sourcecode des Formulars erweitert auf dieses Form3:
// Subroutine will be executed when activating CustomACMPWindow.
procedure FormActivate;
var Str : TStringList;
i : Integer;
temp : String;
posi : Integer;
newtext : String;
begin
Str := TStringlist.create;
try
Str.commatext := GetVarContent('FORM');
for i := 0 to Str.Count - 1 do
begin
posi := 0;
temp := Str.Strings;
Str.Strings := copy(temp, pos('=', temp) + 1, length(temp));
end;
Combobox1.items.assign(Str);
Str.commatext := GetVarContent('FORM2');
for i := 0 to Str.Count - 1 do
begin
posi := 0;
temp := Str.Strings;
Str.Strings := copy(temp, pos('=', temp) + 1, length(temp));
end;
Combobox2.items.assign(Str);
Str.commatext := GetVarContent('FORM3');
for i := 0 to Str.Count - 1 do
begin
posi := 0;
temp := Str.Strings;
Str.Strings := copy(temp, pos('=', temp) + 1, length(temp));
end;
Combobox3.items.assign(Str);
finally
Str.free;
end;
end;
function EscapePropertyValue(APropertyValue: String): String;
begin
Result := StringReplace(APropertyValue, ',', ',,');
end;
procedure OkButtonClick;
var liste1,liste2,liste3 : tStringlist;
i : integer;
begin
liste1:=tstringlist.create;
liste2:=tstringlist.create;
liste3:=tstringlist.create;
try
liste1.Assign(combobox1.items);
liste2.Assign(combobox2.items);
liste3.Assign(combobox3.items);
for i := 0 to liste1.Count - 1 do
begin
liste1.Strings := inttostr(i) +'=' +liste1.Strings;
end;
for i := 0 to liste2.Count - 1 do
begin
liste2.Strings := inttostr(i) +'=' +liste2.Strings[i];
end;
for i := 0 to liste3.Count - 1 do
begin
liste3.Strings[i] := inttostr(i) +'=' +liste3.Strings[i];
end;
SetVarContent('FORM', liste1.commatext);
SetVarContent('FORM2', liste2.commatext);
SetVarContent('FORM3', liste3.commatext);
finally
liste1.Free;
liste2.Free;
liste3.Free;
end;
CloseForm(0);
end;
procedure CancelButtonClick;
begin
// Cancel: Close the window and return error code 1 (failure).
CloseForm(1);
end;
procedure Button1Click;
begin
if (combobox1.items.indexof(combobox1.text) = -1 ) and (trim(combobox1.text) <> '') then
combobox1.items.add(combobox1.text);
end;
procedure Button2Click;
begin
var1 := combobox1.items.indexof(combobox1.text);
combobox1.items.delete(var1);
end;
procedure Button4Click;
begin
if (combobox2.items.indexof(combobox2.text) = -1 ) and (trim(combobox2.text) <> '') then
combobox2.items.add(combobox2.text);
end;
procedure Button3Click;
begin
var2 := combobox2.items.indexof(combobox2.text);
combobox2.items.delete(var2);
end;
procedure Button6Click;
begin
if (combobox3.items.indexof(combobox3.text) = -1 ) and (trim(combobox3.text) <> '') then
combobox3.items.add(combobox3.text);
end;
procedure Button5Click;
begin
var3 := combobox3.items.indexof(combobox3.text);
combobox3.items.delete(var3);
end;
Fehler gibt die Überprüfung nicht an - also alle Syntaxen OK.
Meines erachtens ist alles Richtig - aber es funktioniert trotzdem nicht... Oder habe ich etwas übersehen? Vergessen? Nicht daran gedacht?
Vielen Dank für Ihre Hilfe!
mfg
Daniel
Ich wage mich nun auch in die Command Libary rein. Meine Anforderung ist ein weiteres Feld in der Standortbestimmung um verschiedene Gesellschaften anzugeben.
Eigentlich habe ich die Konfiguration mit den Auswahllisten bereits soweit geändert das ein weiteres Formularfeld hinzugefügt wurde. Wenn ich das Skript dann aktiviere übernimmt mir das Skript die eingefügten Gesellschaften nicht.
Ich habe das Script soweit angepasst das es ein neues %FORM3% hat und auch eine neue Project Variable %COMPANY%. Weiterhin habe ich den Sourcecode des Formulars erweitert auf dieses Form3:
// Subroutine will be executed when activating CustomACMPWindow.
procedure FormActivate;
var Str : TStringList;
i : Integer;
temp : String;
posi : Integer;
newtext : String;
begin
Str := TStringlist.create;
try
Str.commatext := GetVarContent('FORM');
for i := 0 to Str.Count - 1 do
begin
posi := 0;
temp := Str.Strings;
Str.Strings := copy(temp, pos('=', temp) + 1, length(temp));
end;
Combobox1.items.assign(Str);
Str.commatext := GetVarContent('FORM2');
for i := 0 to Str.Count - 1 do
begin
posi := 0;
temp := Str.Strings;
Str.Strings := copy(temp, pos('=', temp) + 1, length(temp));
end;
Combobox2.items.assign(Str);
Str.commatext := GetVarContent('FORM3');
for i := 0 to Str.Count - 1 do
begin
posi := 0;
temp := Str.Strings;
Str.Strings := copy(temp, pos('=', temp) + 1, length(temp));
end;
Combobox3.items.assign(Str);
finally
Str.free;
end;
end;
function EscapePropertyValue(APropertyValue: String): String;
begin
Result := StringReplace(APropertyValue, ',', ',,');
end;
procedure OkButtonClick;
var liste1,liste2,liste3 : tStringlist;
i : integer;
begin
liste1:=tstringlist.create;
liste2:=tstringlist.create;
liste3:=tstringlist.create;
try
liste1.Assign(combobox1.items);
liste2.Assign(combobox2.items);
liste3.Assign(combobox3.items);
for i := 0 to liste1.Count - 1 do
begin
liste1.Strings := inttostr(i) +'=' +liste1.Strings;
end;
for i := 0 to liste2.Count - 1 do
begin
liste2.Strings := inttostr(i) +'=' +liste2.Strings[i];
end;
for i := 0 to liste3.Count - 1 do
begin
liste3.Strings[i] := inttostr(i) +'=' +liste3.Strings[i];
end;
SetVarContent('FORM', liste1.commatext);
SetVarContent('FORM2', liste2.commatext);
SetVarContent('FORM3', liste3.commatext);
finally
liste1.Free;
liste2.Free;
liste3.Free;
end;
CloseForm(0);
end;
procedure CancelButtonClick;
begin
// Cancel: Close the window and return error code 1 (failure).
CloseForm(1);
end;
procedure Button1Click;
begin
if (combobox1.items.indexof(combobox1.text) = -1 ) and (trim(combobox1.text) <> '') then
combobox1.items.add(combobox1.text);
end;
procedure Button2Click;
begin
var1 := combobox1.items.indexof(combobox1.text);
combobox1.items.delete(var1);
end;
procedure Button4Click;
begin
if (combobox2.items.indexof(combobox2.text) = -1 ) and (trim(combobox2.text) <> '') then
combobox2.items.add(combobox2.text);
end;
procedure Button3Click;
begin
var2 := combobox2.items.indexof(combobox2.text);
combobox2.items.delete(var2);
end;
procedure Button6Click;
begin
if (combobox3.items.indexof(combobox3.text) = -1 ) and (trim(combobox3.text) <> '') then
combobox3.items.add(combobox3.text);
end;
procedure Button5Click;
begin
var3 := combobox3.items.indexof(combobox3.text);
combobox3.items.delete(var3);
end;
Fehler gibt die Überprüfung nicht an - also alle Syntaxen OK.
Meines erachtens ist alles Richtig - aber es funktioniert trotzdem nicht... Oder habe ich etwas übersehen? Vergessen? Nicht daran gedacht?
Vielen Dank für Ihre Hilfe!
mfg
Daniel