Dies ist ein Code -Snippet zur Unterscheidungssprache, das SQL ähnelt. Könnten Sie sich diesen Ausschnitt ansehen und alle schlechten Konstruktionen entdecken? Im Moment wird diese Unterroutine auf eine andere Unterroutine aufgerufen und schleift weiter. < /P>
subroutine(get_path(alt_sel_cat_id = f8) = vc)
declare fldr_cnt = i4 with protect, constant(size(fav_fldr->fldr, 5))
declare pos1 = i4 with protect, noconstant(0)
declare idx = i4 with protect, noconstant(0)
declare folder_id = f8 with protect, noconstant(0)
declare parent_id = f8 with protect, noconstant(0)
declare is_root = i2 with protect, noconstant(0)
declare path = vc with protect, noconstant("")
set folder_id = alt_sel_cat_id
set parent_id = fav_fldr->fldr[LOCATEVAL(pos1, 1, fldr_cnt, folder_id, fav_fldr->fldr[pos1].folder_id)].parent_folder_id
set is_root = EVALUATE2(IF(parent_id = 0) 1 ELSE 0 ENDIF)
set path = fav_fldr->fldr[LOCATEVAL(pos1, 1, fldr_cnt, folder_id, fav_fldr->fldr[pos1].folder_id)].folder
while (is_root = 0) ;not the parent folder
if (parent_id = 0)
set is_root = 1 ;reached the parent, time to stop
else
;find the index of the parent folder
set pos1 = LOCATEVAL(idx, 1, fldr_cnt, parent_id, fav_fldr->fldr[idx].folder_id)
if (pos1 > 0) ;we located the parent folder in the record
set path = BUILD2(fav_fldr->fldr[pos1].folder, "/", path)
set parent_id = fav_fldr->fldr[pos1].parent_folder_id ;update parent_id to the parent's parent folder_id
endif
endif
endwhile
return (path)`enter code here`
end ;get_path
Dies ist ein Code -Snippet zur Unterscheidungssprache, das SQL ähnelt. Könnten Sie sich diesen Ausschnitt ansehen und alle schlechten Konstruktionen entdecken? Im Moment wird diese Unterroutine auf eine andere Unterroutine aufgerufen und schleift weiter. < /P> [code]subroutine(get_path(alt_sel_cat_id = f8) = vc) declare fldr_cnt = i4 with protect, constant(size(fav_fldr->fldr, 5)) declare pos1 = i4 with protect, noconstant(0) declare idx = i4 with protect, noconstant(0)
declare folder_id = f8 with protect, noconstant(0) declare parent_id = f8 with protect, noconstant(0) declare is_root = i2 with protect, noconstant(0) declare path = vc with protect, noconstant("")
set folder_id = alt_sel_cat_id set parent_id = fav_fldr->fldr[LOCATEVAL(pos1, 1, fldr_cnt, folder_id, fav_fldr->fldr[pos1].folder_id)].parent_folder_id set is_root = EVALUATE2(IF(parent_id = 0) 1 ELSE 0 ENDIF) set path = fav_fldr->fldr[LOCATEVAL(pos1, 1, fldr_cnt, folder_id, fav_fldr->fldr[pos1].folder_id)].folder
while (is_root = 0) ;not the parent folder if (parent_id = 0) set is_root = 1 ;reached the parent, time to stop else ;find the index of the parent folder set pos1 = LOCATEVAL(idx, 1, fldr_cnt, parent_id, fav_fldr->fldr[idx].folder_id) if (pos1 > 0) ;we located the parent folder in the record set path = BUILD2(fav_fldr->fldr[pos1].folder, "/", path) set parent_id = fav_fldr->fldr[pos1].parent_folder_id ;update parent_id to the parent's parent folder_id endif endif endwhile
return (path)`enter code here` end ;get_path [/code]
Ich möchte das Suchergebnis -Snippet für meine Website auf Google aktualisieren. Das aktuelle Snippet zeigt veraltete Inhalte und Metadaten an. Ich habe bereits versucht, das URL -Inspektionstool von...
Wir konvertieren die MD -Dateien (Markdown) in HTML -Dateien mit Jekyll und hosten die HTML -Dateien auf der Website. Sie haben so gemacht.
--Plagen-Pages Quelle
Mein MD -Dateicode -Snippet...
In dieser Schleife versuche ich, Benutzereingaben zu nehmen und sie kontinuierlich in eine Liste zu setzen, bis sie Stop schreiben. Wenn die Schleife unterbrochen ist, druckt die für die Schleife...