Namen standardmäßig hierher (1); // Beispiel eines assoziativen Arrays aa = Associative Array(); aa["text"] = "Erste Zeile ohne Bild ¤tile|img¤ Text und ¤windmap|img¤ mehrere Bilder ¤tile|img¤ ¤windmap|img¤ Bilder letzte Zeile"; aa["Bilder"] = Assoziatives Array(); aa["images"]["tile"] = Neues Bild("$SAMPLE_IMAGES/tile.jpg"); aa["images"]["windmap"] = New Image("$SAMPLE_IMAGES/windmap.png"); find_imgs = function({str}, {Default Local}, /* find img names from string */ imgs = {}; cur_img = Regex(str, "(¤.+?\|img¤)"); While(! IsMissing(cur_img), Insert Into(imgs, cur_img); Substitute Into(str, cur_img, ""); cur_img = Regex(str, "(¤.+?\|img¤)"); ); return(imgs) ; ); create_line_hlb = function({cur_str, img_list, aa, hlb = H List Box()}, {Default Local}, /* eine Zeile des Textes erstellen */ If(Length(cur_str) < 1, // keine aktuelle str return(hlb); ); If(N Items(img_list) == 0, // keine Bilder übrig -> restlichen Text zum Textfeld hinzufügen Insert Into(hlb, Text Box(cur_str)); return(hlb); ) ; img_idx = Contains(cur_str, img_list[1]); If(img_idx == 1, cur_img = Remove From(img_list, 1)[1]; img = aa[Substr(Word(1, cur_img, "|"), 2)]; hlb << Append(img); cur_str = Substr(cur_str, Length(cur_img) + 1); , txt = Substr(cur_str, 1, img_idx - 1); Insert Into(hlb, Text Box(txt) ); cur_str = Substr(cur_str, img_idx ); ); create_line_hlb(cur_str, img_list, aa, hlb); ); text_to_displaybox = function({aa}, {Default Local}, /* erstellt die Displaybox basierend auf einem assoziativen Array */ vlb = V List Box(); For Each({line}, Words(aa["text"], "\ !N"), img_list = find_imgs(line); hlb = create_line_hlb(line, img_list, aa["images"] /*,H List Box()*/); vlb << Append(hlb); ); return( vlb); ); // Demo des Skripts // Größe ändern, um neues Fenster etwas kleiner zu machen aa["images"]["tile"] << Set Size({128, 128}); aa["images"]["windmap"] << Setze Größe({128, 128}); nw = Neues Fenster ("test", text_to_displaybox(aa)); Schreiben();