livecode

How do I create an array of buttons with a script?

橙三吉。 提交于 2019-12-13 18:25:39
问题 I'd like to create an array of buttons with a script. This includes setting the size and position and assigning a mouseUp hander go them. The mouseUp handler should be on mouseUp go to card "aName" end mouseUp The list of names is in a text variable tCardNames. Each line has a card name. 回答1: Here's a slightly different approach. The repeat for each form is more efficient for long lists than repeat with , but in this situation there would likely be no appreciable difference. on createButtons

Combo box not focusable

大城市里の小女人 提交于 2019-12-13 03:24:39
问题 Is there any way we can set the combo box not focusable? Because every time I select an item from combo box (drop down list), the keyboard shows up and the text from drop down list can be edited. I can't find any property from property inspector to disable this up. Or maybe we can disable this one programmatically in which I don't know. 回答1: Consider using an Option Menu (unlike a Combo Box an Option Menu has no field which a user can type into - and therefore no unwanted appearance of the

Stack window opens with incorrect size

半城伤御伤魂 提交于 2019-12-11 22:33:47
问题 My application has 2 stacks. Stack 1 is "main" and it opens stack 2. Stack 2 is "slideview" and shows an image like an e-book. My application is for iOS. I test on iPad. I save a standalone application to install on iOS. I use program "iExplorer" to open a directory ub my app on ipad and copy stack 2 to the "documents" directory. The script in stack 1 is: on mouseUp put specialfolderpath("documents") into rootFolder put rootFolder& "/stack2.livecode" into filestack go stack filestack end

Newbie cant get JSON

北战南征 提交于 2019-12-11 16:07:26
问题 In LiveCode I have a stack connecting to a localhost MongoDB, the stack has a button with a mouseup handler and the function JSONToArray from MergJSON and two fields: "A" to receive the server answer "as is" and field B" to receive the decoded JSON. This is the script of the button: on mouseup set the hideConsoleWindows to true put shell("C:\\mongodb\bin\mongo.exe --eval" && quote & \ "printjson(db.test.findOne())" & quote) into pJSON put pJSON into fld "a" put JSONToArray(pJSON) into tArray

Square brackets with mergJSON in LiveCode - what am I doing wrong?

匆匆过客 提交于 2019-12-11 11:45:25
问题 The web service I'm connecting to returns its JSON in response to a query, thus: [{ "dob":"25/12/68", "firstname":"Mary", "lastmoddate":1368519205101, "lastname":"Smith", "resident_id":"712d9b726603426ca36f9c77fa644ae9", "createddate":1368519205101 }] ... which I pull from the web service and store in a field called "My JSON". As you'll notice there are square brackets at the beginning and end which I believe is valid for JSON arrays? I have the following script in LC which at the moment just

How to store pictures in a stack?

时光怂恿深爱的人放手 提交于 2019-12-11 08:29:07
问题 In Hypercard I can store pictures only on cards. In LiveCode it is possible to store a collection of pictures on the stack level. Is this correct? If yes, how do I load all the pictures in a folder into a stack? And how do I change the read script to only read all the references to pictures into the stack? 回答1: I think it's not possible to store images in a stack, but not on a card. For storing images on a card, you'll want the import command. It will place an image on the current (frontmost)

Retrieve data from server

旧时模样 提交于 2019-12-11 02:57:19
问题 I am suppose to retrieve data from a website ( example http://intimes.eu.pn/getsurvey.php ) How should i start ? guideline please 回答1: Here's how to get started: //PLACE THE URL FROM WHICH YOU WILL RETRIEVE DATA INTO ANY VARIABLE (tURL) put "http://intimes.eu.pn/getsurvey.php" into tURL // RETRIEVE DATA FROM SERVER. PLACE DATA INTO VARIABLE tDATA put url tURL into tData // DO SOMETHING WITH tData To work with JSON within Livecode, you will have to use a library that parse JSON. Investigating

200 error: missing username when logging in using Parse and LiveCode

跟風遠走 提交于 2019-12-10 10:34:40
问题 I am trying to login to Parse through LiveCode but keep getting this error: {"code":200,"error":"missing username"} I have been able to create users, even validate user's email (through the REST API in Parse) but when I try to login I keep getting an error. I think there is something wrong with my JSON formatting or the GET call but I can't figure it out. command mainLogin local tLoginA, tLoginJson, tReturn, tLogin setHeaders put fld "username" into tLoginA [ "username" ] put the cPassword of

200 error: missing username when logging in using Parse and LiveCode

安稳与你 提交于 2019-12-06 14:06:49
I am trying to login to Parse through LiveCode but keep getting this error: {"code":200,"error":"missing username"} I have been able to create users, even validate user's email (through the REST API in Parse) but when I try to login I keep getting an error. I think there is something wrong with my JSON formatting or the GET call but I can't figure it out. command mainLogin local tLoginA, tLoginJson, tReturn, tLogin setHeaders put fld "username" into tLoginA [ "username" ] put the cPassword of fld "password" into tLoginA [ "password" ] put urlEncode ( JSON_stringified ( tLoginA ) ) into tLogin

How do I get the path to the currently selected file

心已入冬 提交于 2019-12-04 17:35:44
Does VBScript have a function to get the path to the currently selected file in File Explorer? If so, what is the function? I'm looking for something like Set fileObj = CreateObject("Scripting.FileSystemObject") dim filepath filepath = fileObj.GetCurrentSelection() 'doesn´t exist dim result result = filepath 'communicate with LiveCode I wrote a simple example. Keep in mind there may be more than one open windows explorer window and this will list them all. Function GetSelectedFiles() 'Returns paths as array of strings Dim FileList, Window, SelectedItem 'avoid duplicates by storing paths in