English
Source / code snippets

JSON + Postleitzahlen (zipcodes) USA

 

H.Brill
have time a .csv File (42702 Entries) to a
MEGA - .json - File konvertiert.
of these small Program can The Entries
the jeweiliges Bezirks reading. with one Click on The
Listbox with the Bezirken go in the GridBOX
The suitable Bundesstaaten with the Zipcode
displayed.
Declare String File, districts, decompose, item
Declare lever btn1, grid, lb
Declare Long end, js ,xs
districts = "NH,NY,PR,VI,MA,RI,ME,VT,CT,NJ,AE,PA,DE,DC,VA,MD,WV,NC,SC,\
GA,FL,AA,AL,TN,MS,KY,OH,IN,MI,IA,WI,MN,SD,ND,MT,IL,MO,KS,NE,LA,AR,OK,\
TX,CO,WY,ID,UT,AZ,NM,NV,CA,AP,HI,AS,GU,PW,FM,MP,MH,OR,WA,AK"
decompose = "Bezirk;0;60;Bundes-Staat;0;120;Zip-Code;0;100"
end = 0
File = "F:\ZipCodes.Json"' ***************** PFAD ANPASSEN ***************************
Window Title "US-ZipCodes (Postleitzahlen) USA"
Window 600, 400
btn1 = Create("Button",  %HWnd, "Ende", 10, 10, 60, 25)
grid = Create("GridBox", %HWnd, decompose, 0, 10, 50, 300, 200)
Create("Text", %HWnd, "vorhandene Bezirke", 400, 25, 140, 25)
lb   = Create("Listbox", %HWnd, 1, 400, 50, 60, 200)
InitListbox()

If FileExists(File)

    js = Create("Json", File)

Else

    MessageBox("Keine File ZipCodes.Json vorhanden", "Fehler", 0)
    End

EndIf

WhileNot end

    WaitInput

    If Clicked(btn1)

        end = 1

    ElseIf Clicked(lb)

        item = GetString$(lb, GetCurSel(lb))

        If item <> ""

            Search(item)

        EndIf

    EndIf

EndWhile

Proc InitListbox

    ClearList
    Move("StrToList", districts, ",")
    Move("ListToHandle", lb)

ENDPROC

Proc Search

    Parameters String item
    Declare Hash entry[], String Schluessel, worth, Long i

    WhileLoop 0, Json("Count", js) - 1

        If Json("Name", js, &LOOP) = item

            xs = Json("GetObject", js, item)
            entry[] = Json("Hash", xs)
            ClearList grid
            ForEach entry[], Schluessel, worth
            AddStrings(grid, item + "|" + worth + "|" + Schluessel)
            EndFor
            Break

        EndIf

    EndWhile

ENDPROC

End

is Yes amazing, How quick JSON there's.
Please Dateipfad properly Change.

815 kB
Hochgeladen:03/25/23
Downloadcounter61
Download
 
Benutze XPROFAN X3 + FREEPROFAN
Wir sind die XProfaner.
Sie werden von uns assimiliert.
Widerstand ist zwecklos!
Wir werden alle ihre Funktionen und Algorithmen den unseren hinzufügen.

Was die Borg können, können wir schon lange.
03/25/23  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

952 Views

Untitledvor 0 min.
Manfred Barei12/09/23
Thomas Zielinski06/28/23
Paul Glatz06/22/23
E.T.06/12/23
More...

Themeninformationen

this Topic has 1 subscriber:

H.Brill (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie