English
Forum

Source as JSON-File

 
I have come along, that JSON-processing with aktuellem XProfan directly possible his should.

who would like, the can here a actually copy all Source  [...]  as JSON-File herunterladen:

Download

I can it self not yet testing but Perhaps has Yes someone Fun so.

eachone Datensatz exists from (int) id, (int) fpid, (Text) title, (text_base64) Text.

let itself something like well so process?

whom Split are missing: simply report!

Zurücklesen into Community so too possible.

1.719 kB
Bezeichnung:quelltexte.json
Version:04.06.2018
Kurzbeschreibung: Source as JSON-File
Hochgeladen:06/04/18
Downloadcounter19
Download
 
06/04/18  
 




Jörg
Sellmeyer
I habs time runtergeladen and get with folgendem code from the Help only ne Schutzverletzung displayed.
The Schutzverletzung comes already directly to the Create. means have either You The json-Konventionen not correctly eingehalten or Roland
Cls
showmax
declare long js, xs, list
js = Create("json","C:\\Profan\\projects\\XProfanQuelltexte\\quelltexte.json")
print "Json-Objekt from File import and "
var string Text = json("TEXT", js, 1)
print "lesbar Show:"
print Text
print
print "Als Json-String Show:"
Text = json("TEXT", js, 0)
print Text
print
print "Taste pressing ..."
waitinput

i'm too none clear, How one a unbekanntes json-File rangehen can.
in the Help stand only Examples, The terms from whom json-Objects use.
the nützt but nothing, if one on one ranwill, that no known Schlüsselnamen u.s.w has.
particularly with whom Objects needed one Yes always The Objektnamen.
can you not time ne smaller ones Testdatei Upload? Perhaps are The 5mb too simply too much, circa tappt im dunkeln (How supra), in a String To reading.
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
06/05/18  
 



I have these function uses:  [...]  -

The File quelltexte.json can itself in JS and PHP free from problems again reading.

whom reason for crash in XProfan can presumably Roland best to determine.

The File stops I so far for aale.
 
06/05/18  
 




RGH
The File is no JSON-Objekt ("{.....}"), separate a JSON-list ("[.....]").
The function Create("JSON", File) expects though one JSON-Objekt!

means simply one {"Texte": to the führenden eckigen Klammer insert and a } behind the schließenden eckigen Klammer settle and already works it! then having we one Objekt, that The list "Texte" contains.

Greeting
Roland

PS: How is a unknown JSON-File auswertet, show I then The next days. today is it me To late. circa 06:30 goes the Wecker.
 
Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4
06/05/18  
 




Michael
W.
One example for Json there were in Paules Forum. Ausserdem can the in a Hash transform and simply leaf through. is too there described.

Json("Hash"
 
Alle Sprachen
System: Windows 8/10, XProfan X4
Programmieren, das spannendste Detektivspiel der Welt.
06/07/18  
 




RGH
here one kurzes example, the shows, How one a unbekannntes JSON-Objekt herangehen can. The JSON-File is the supra mentioned JSON-list, The How of me described to a JSON-Objekt extended watts.
Window 1024, 768
// JSON-Objekt reading
var int js = Create("json","F:\\Entw\\Profan projects\\X4\\quelltexte2.json")
// Wieviele Elmente contains the Objkekt
var int anz = json("Count", js)
print st$(anz) + " element(e)"// 1 element
// type the Elements
var string type[] = "", "Number", "String", "Boolean", "NULL", "Liste", "Objekt"
var int typnr = json("Type", js, 0)
print typnr, type[typnr]
// name the list
var string name = json("Name", js, 0)
print name
// list reading
var int list = json("getList", js, name)
// Wieviele Elmente contains The list
anz = json("Count", list)
print st$(anz) + " element(e)"// 1 element
WaitInput
End

in the further course the investigation would one check, that any lists-Entries Objects are, The each four Strings include: id, fpid, title, Text.

Greeting
Roland
 
Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4
06/08/18  
 




RGH
And so could one one Objekt as Profan-Source (Well, its yet Nacharbeit necessary) abspeichern:
Window 1024, 768
// JSON-Objekt reading
var int js = Create("json","F:\\Entw\\Profan projects\\X4\\quelltexte2.json")
// list reading
var int list = json("getList", js, "texte")
// the first Objekt the list einleseb
var int obj = json("getObject", list, 0)
var string title = json("getString", obj, "title")
var string Text  = json("getString", obj, "text")
// title contains whom cover the Program, Text whom Base64 codierten Programmtext
// Text decodieren
Text = decode64(Text)
// a couple HTML-Tags konvertieren (here nure some as example. there's More.)
Text = translate $(Text, "& #40;", "(")// space between & and # Remove!
Text = translate $(Text, "& #41;", ")")// space between & and # Remove!
Text = translate $(Text, """, "\q")
print Text
// as Save file
Block Write title+".prf", Text
waitinput

(space between & and # had I insert, so The Page not same Translated.)

it find itself yet further HTML-Tags in eckigen clinging in the Programmtext. Also there well another Headline and a Kommentarzeile.

with something hoisted ließe itself but one Program develop, that The cover all 1849 Source in a list box or of/ one GridBOX to selection anbietet and the desired as Program export.

Greeting
Roland
 
Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4
06/08/18  
 




Jörg
Sellmeyer
calm - once my computer again runs, werd I so time befassen. me hovers one Program to, the then arbitrary json-Objects z. B. as Treeview indicating. somehow bid the structure for on, find I.
 
XProfan X4
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
06/09/18  
 




RGH
The something improved Translates for HTML-tags into Source code (s.o.):
set("RegEx", 1)
Text = translate $(Text, "& #40;", "(")
Text = translate $(Text, "& #41;", ")")
Text = translate $(Text, "& #58;", ":")
Text = translate $(Text, "ä", "ä")
Text = translate $(Text, "ö", "ö")
Text = translate $(Text, "ü", "ü")
Text = translate $(Text, "ß", "ß")
Text = translate $(Text, """, "\q")
Text = translate $(Text, "~[b[ -Z^-z]*~]", "// ")
Text = translate $(Text, "~[/b[ -Z^-z]*~]", "")
Text = translate $(Text, "~[code[ -Z^-z]*~]", "")
Text = translate $(Text, "~[/code[ -Z^-z]*~]", "")
Text = translate $(Text, "~[color=[ -Z^-z]*~]", "")
Text = translate $(Text, "~[/color[ -Z^-z]*~]", "")

Greeting
Roland
 
XProfan X3
Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4
06/09/18  
 




Michael
W.
iF, we need one verbessertes html_entity_decode(), the then too any Sonderfälle again entzaubert.
are The HexCodes a Klassifizierung?
or a further ID?


[...b:...0a03fb2d32]WAV-take über MCI[.../...b...:...0a03fb2d32]
[...code...:...1...:...0a03fb2d32]...[.../...code...:...1...:...0a03fb2d32]
 
Alle Sprachen
System: Windows 8/10, XProfan X4
Programmieren, das spannendste Detektivspiel der Welt.
06/09/18  
 




RGH
straight is me noticed, I a important JSON-function in the Help forget have:
js = json("Parse", Text)
it'll one Json-Objekt from the String Text created. Text must one gültiges Json-Objekt in Textform his.

so could one The above-mentioned File with the Quelltexten too directly use:
var string Text = blockread("F:\\Entw\\Profan projects\\X4\\quelltexte.json")
Text = "{\qtexte\q:" + Text + "}"
var int js = json("Parse", Text)

The Json-list becomes into String Text red, into Json-Objekt gepackt and Parse then into Json-Objekt js read.

Greeting
Roland
 
Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4
06/10/18  
 




Michael
W.

important JSON-function in the Help forget


though Json() already one great container is...

Roland can You then too the
html_entity_decode() and the Gegenstück html_entities()
as functions moreover give liberally? the goes in Pascal codiert still something flotter.

Beschreibungen are under PHP to find.
 
Alle Sprachen
System: Windows 8/10, XProfan X4
Programmieren, das spannendste Detektivspiel der Welt.
06/11/18  
 




Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

15.681 Views

Themeninformationen



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