Advertisement
Guest User

Untitled

a guest
Apr 18th, 2015
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.15 KB | None | 0 0
  1. name = "Paul James"
  2. age = 25
  3. result = My name is &name, I am &age years old.
  4.  
  5. dimension x[5];
  6. x[0] = "box"
  7. x[1] = "area"
  8. text.&x[0]..text = "textbox" ---> textbox.text="textbox"
  9. text.&x[1]..text = "textarea" ---> textarea.text="textarea"
  10.  
  11. JSONArray response =
  12. [{"name":"a","middlename":"aa","surname":"aaa"},{"name":"b","middlename":"bb","surname":"bbb"},{"name":"c","middlename":"cc","surname":"ccc"}]
  13.  
  14. temp[] = [{name,middlename,surname}];
  15.  
  16. String[] name = new String[response.firstobject.length];
  17. String[] middlename = new String[response.firstobject.length];
  18. String[] surname = new String[response.firstobject.length];
  19.  
  20. @SuppressWarnings("null")
  21. public ArrayList<String> parseJson(JSONArray ja) throws JSONException{
  22. ArrayList<String> listItems = new ArrayList<String>();
  23. String[] temp = null;
  24. //Get all the fields first
  25. for (int i=0; i<=0; ++i){
  26. JSONObject jo = ja.getJSONObject(i);
  27. if(jo.length()>0){
  28. temp = new String[jo.names().length()];
  29. for(int x=0; x<jo.names().length(); ++x){
  30. temp[x] = jo.names().getString(x);
  31. }
  32. }
  33. }
  34. }
  35.  
  36. STORE 'city' TO cVarCity
  37. REPLACE (cVarCity) WITH 'Paris'
  38.  
  39. //--------- ejemplos :
  40. // STRTRAN("Hola * mundo","*", "//") ==> "Hola // mundo"
  41. public String STRTRAN(String cExpression, String cFindString, String cReplacement){
  42. return cExpression.replace(cFindString, cReplacement);
  43. }
  44.  
  45. //------------------ ejemplos:
  46. // miToolkit.CHRTRAN("ABCDEF", "ACE", "XYZ"); // muestra XBYDZF. ok
  47. // miToolkit.CHRTRAN("ABCDEF", "ACE", "XYZQRST"); // muestra XBYDZF. ok
  48. // miToolkit.CHRTRAN("ABCD", "ABC", "YZ"); // muestra YZCD. No es como fox
  49. public String CHRTRAN(String cString, String cFindChars, String cNewChars){
  50. String cResult = cString;
  51. char[] aFindChars;
  52. char[] aNewChars;
  53. int nLength = cFindChars.length();
  54.  
  55. aFindChars = cFindChars.toCharArray();
  56. aNewChars = cNewChars.toCharArray();
  57. if(cNewChars.length() < nLength){
  58. nLength = cNewChars.length() ;
  59. }
  60. for(int i=0; i < nLength; i++){
  61. cResult = cResult.replace( aFindChars[i], aNewChars[i] );
  62. }
  63. return cResult;
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement