Startseite › Foren › Deutsches LiveCode-Forum › Datum aus Feld richtig übernehmen
- Dieses Thema hat 4 Antworten und 2 Teilnehmer, und wurde zuletzt aktualisiert vor 3 Jahren, 9 Monaten von
Klaus Major.
-
AutorBeiträge
-
-
Mai 23, 2021 um 15:48 Uhr #28525
Hallo zusammen.
Ich habe einen Code der wie folgt aussieht:
if Fld"Tour">0 then
if auswahl = "ABGLEICH" then
set the URL of widget "Browser" to "http://" & fld "ss" & "/cgi-bin/report_inbound_ofd.cgi?doAction=true&reportType=simple&stimestamp_from=2021-05-10+00%3A00%3A00&stimestamp_till=2021-05-10+23%3A59%3A59&tour=" &Fld "tour"
show widget "Browser"
put "ABGLEICH" into field "ueber"
end if
else
if auswahl = "ABGLEICH" then
set the URL of widget "Browser" to "http://" & fld "ss" & "/cgi-bin/report_inbound_ofd.cgi?doAction=true&reportType=simple&stimestamp_from=2021-05-10+00%3A00%3A00&stimestamp_till=2021-05-10+23%3A59%3A59&tour=-1"
show widget "Browser"
put "ABGLEICH" into field "ueber"
end if
end if
nun werden in 2 Felder:
Datum von: 10.05.2021 (Feldname: davon)
Datum bis: 10.05.2021 (Feldname: dabis)Wie kann ich nun die die Variable in dem Code so eingeben, dass die Daten auch so angezeigt werden:
„2021-05-10“Danke für die Hilfe.
-
Mai 23, 2021 um 16:01 Uhr #28947
Hallo ASNCM,
willkommen im Forum!
Tut mir leid, aber es gibt immer noch Probleme mit dem automatischen Freischalten von Postings.1. Ganz wichtig, beim Zusammensetzen von Namen, Dateipfaden und auch URLs immer KLAMMERN verwenden, sonst kommt LC schon mal durcheinander, also:
... set the URL of widget "Browser" to ("http://" & fld "ss" & "/derrestdannhier.html") ...
Ich bin nicht sicher, ob ich verstehe, was Du willst…
Du hast zwei Felder mit Inhalt:
Datum von: 10.05.2021 (Feldname: davon)
Datum bis: 10.05.2021 (Feldname: dabis)
Und diese beiden Daten möchtest Du in der URL unterbringen aber im Format 2021-05-10.
Ist das korrekt?Wenn ja, dann geht es so:
... put fld "davon" into tVon put fld "dabis" into tBis ## Nun ins gewünschte Format umwandeln: set itemdel to "." put item 3 of tVon & "-" & item 2 of tVon & "-" & item 1 of tVon into tVon2 ## item 1 = 2021, item 2 = 05, item 3 = 10 ## tVon -> 2021-05-10 put item 3 of tBis & "-" & item 2 of tBis & "-" & item 1 of tBis into tBis2 ## Dito, tBis -> 2021-05-10 ## Jetzt die beiden Variablen in die URL einbauen (String zusammensetzen): ... ## if... set the URL of widget "Browser" to ("http://" & fld "ss" & "/cgi-bin/report_inbound_ofd.cgi?doAction=true&reportType=simple&stimestamp_from=" & tVon & "+00%3A00%3A00&stimestamp_till=" & tBis & "+23%3A59%3A59&tour=" & Fld "tour") ...
Gruß
Klaus
-
Mai 23, 2021 um 17:13 Uhr #28949
Zum besseren Verständnis hier mal in lang:
... put "http://" into tURL put fld "ss" AFTER tURL put "/cgi-bin/report_inbound_ofd.cgi?doAction=true&reportType=simple&stimestamp_from=" AFTER tURL put tVon AFTER tURL put "+00%3A00%3A00&stimestamp_till=" AFTER tURL put tBis AFTER tURL put "+23%3A59%3A59&tour=" AFTER tURL put Fld "tour" AFTER tURL set the URL of widget "Browser" to tURL ...
-
Mai 24, 2021 um 11:50 Uhr #28970
Hallo.
hat geklappt.
Vielen Dank.habe aber in der URL „& tVon & „+00%3A00%3A00&stimestamp_till=“ & tBis &“
auf „& tVon2 & „+00%3A00%3A00&stimestamp_till=“ & tBis2 &“ abändern müssen, damit es funktioniert.Aber alles super !
Vielen Dank. -
Mai 24, 2021 um 14:05 Uhr #28979
Ach ja, sorry, made in Eile und so… 😀
-
-
AutorBeiträge
- Du musst angemeldet sein, um auf dieses Thema antworten zu können.