Jump to content

mewindy

Members
  • Content Count

    19
  • Joined

  • Last visited

Community Reputation

0 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. for MACOS I use procedure TForm1.Exec(FileName: PWideChar); var Workspace: NSWorkspace; NSApp: NSApplication; Nw: NSWindow; begin if fileexists(FileName) then begin Workspace := TNSWorkspace.Create; Workspace.launchApplication(NSSTR(FileName)); Workspace.release; end; end; and in the uses: Macapi.Foundation, Macapi.ObjectiveC, Macapi.Helpers, Macapi.AppKit to execute another program or use _system(PAnsiChar(p_cmd)); to execute a command (e.g terminal command) where p_cmd is string e,g '/usr/local/bin/curl "mycommandhere"
  2. mewindy

    Android Compiler Issue in Delphi Tokyo (10.2.3)

    one solution i have found is to disable all the unnecessary android library files in the project configuration/libraries (right hand pane)
  3. mewindy

    10.3 vers 10.2 Linux

    goodbye to this forum where you have people like this on here posting like this
  4. mewindy

    10.3 vers 10.2 Linux

    OK. for some reason having a tchart on the tlayout is the problem when using tlayout.makescreenshot if I set the tchart to not visible then no error
  5. mewindy

    10.3 vers 10.2 Linux

    ignore
  6. mewindy

    New to Json

    OMG you are correct! I should have spotted that its working now thanks Remy!
  7. mewindy

    New to Json

    HI thanks for the help so far here is the raw data to st as {"data":{"did":"001D0A710197","ts":1557136813,"conditions":[{"lsid":223656,"data_structure_type":1,"txid":1,"temp": 52.7,"hum":66.3,"dew_point": 41.8,"wet_bulb": 46.2,"heat_index": 51.7,"wind_chill": 52.7,"thw_index": 51.7,"thsw_index": 49.7,"wind_speed_last":0.00,"wind_dir_last":0,"wind_speed_avg_last_1_min":0.00,"wind_dir_scalar_avg_last_1_min":null,"wind_speed_avg_last_2_min":0.00,"wind_dir_scalar_avg_last_2_min":null,"wind_speed_hi_last_2_min":0.00,"wind_dir_at_hi_speed_last_2_min":0,"wind_speed_avg_last_10_min":0.00,"wind_dir_scalar_avg_last_10_min":null,"wind_speed_hi_last_10_min":0.00,"wind_dir_at_hi_speed_last_10_min":0,"rain_size":2,"rain_rate_last":0,"rain_rate_hi":0,"rainfall_last_15_min":0,"rain_rate_hi_last_15_min":0,"rainfall_last_60_min":0,"rainfall_last_24_hr":0,"rain_storm":null,"rain_storm_start_at":null,"solar_rad":0,"uv_index":0.0,"rx_state":0,"trans_battery_flag":0,"rainfall_daily":0,"rainfall_monthly":0,"rainfall_year":0,"rain_storm_last":null,"rain_storm_last_start_at":null,"rain_storm_last_end_at":null},{"lsid":223554,"data_structure_type":4,"temp_in": 69.1,"hum_in":38.2,"dew_point_in": 42.6,"heat_index_in": 66.8},{"lsid":223553,"data_structure_type":3,"bar_sea_level":29.932,"bar_trend": 0.028,"bar_absolute":29.404}]},"error":null} if I use the code like JsonValue := TJSONObject.ParseJSONValue(st); if JsonValue <> nil then try JsonObject := JsonValue as TJSONObject; JsonData := JsonObject.GetValue('data') as TJSONObject; JsonConditions := JsonData.GetValue('conditions'); if (JsonConditions is TJSONArray) then begin JsonObject := (JsonConditions as TJSONArray).Items[0] as TJSONObject; Branch:= JsonObject.GetValue('temp').Value; memo1.Lines.add('Parsed temperature '+branch); JsonObject := (JsonConditions as TJSONArray).Items[1] as TJSONObject; Branch:= JsonObject.GetValue('bar_sea_level').Value; memo1.Lines.add('Parsed barometer '+branch); end; finally JsonValue.Free; end; then the second part to get the bar_sea_level causes an access violation error (i.e I have tried access as items[1] so I must be still doing something wrong
  8. mewindy

    10.3 vers 10.2 Linux

    I might have found the problem a global variable that was initialised at form create needing to be re initialised when used in a for loop (it must have been going out of range of the loop) will know after more testing if that was it ...and nope after testing more..one day I might figure it out!
  9. mewindy

    New to Json

    HI all just need a bit of help using Delphi's json functions please 🙂 I have this code working OK e.g st := tempstr; JSonObject := TJSonObject.Create; JsonValue:=JSonObject.ParseJSONValue(st); JsonValue:=(JsonValue as TJSONObject).Get('data').JSONValue; JsonValue:=(JsonValue as TJSONObject).Get('conditions').JSONValue; if (JSONValue is TJSONArray) then begin Branch := ((JSONValue as TJSONArray).Items[0] as TJSonObject).Get('temp').JSONValue.Value; end; JSonObject.Free; but I want to get data from a data pair that is on a second bracketed data ie. it works as above for the first data array but the json data has another data array i.e first data array pairs},{second data array pairs how to I read from the second data array ? thanks! (just putting the name in as in the branch code above that is in the second data array causes an error 🙂
  10. mewindy

    10.3 vers 10.2 Linux

    i think its a red herring as its random I did see a message in the console about memory corruption so something else going wrong someone else in my code but it just happens to be tripping up at that point?
  11. mewindy

    10.3 vers 10.2 Linux

    that was not it....the problem is the error is random..does not happen every time
  12. mewindy

    10.3 vers 10.2 Linux

    OK..progress it turns out that I had a tchart on the layout1 and I had set thcart.enabled to false and also locked when doing the layout1.makescreenshot setting those to false before the makescreenshot seems to have fixed it... will test more.. so an obscure bug/change from 10.2 to 10.3 that has been driving me nuts lol
  13. mewindy

    10.3 vers 10.2 Linux

    OK, this is the problem code (illustration, i.e simplified) in 10.3 but not in 10.2 var forimage:tbitmap; begin formimage:=layout1.makescreenshot; end;
  14. mewindy

    10.3 vers 10.2 Linux

    update, using try, except,then log the error, i have managed to trap where the error is not sure what is wrong yet with the code but will try different things
  15. mewindy

    10.3 vers 10.2 Linux

    a bit more info If I run the linux program in the compiler its actually an eaccess violation so I have some variable going out of range or similar the problem is I cant get the compiler to show the source code point as it wants to know the location of a .so linux library file..but that is only my linux machine so I press ignore..the next time the error occurs I try trace into..but I just get the cpu screen...how do I use that info? 🙂
×