Results 1 to 6 of 6

Thread: i want generate this json array type in vb

  1. #1

    Thread Starter
    Fanatic Member Black_Storm's Avatar
    Join Date
    Sep 2007
    Location
    any where
    Posts
    577

    Post i want generate this json array type in vb

    hi this is php json array used in telegram now i want create this json in vb how can do that:

    PHP Code:

    $keyboard 
    = array(
        
    'keyboard' => array(
            array(
    'A'),
            array(
    'B'),
            array(
    'C'),
        ),
    'resize_keyboard' => true
    ); 

  2. #2
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    5,904

    Re: i want generate this json array type in vb

    Have a look in the CodeBank for JSON samples

  3. #3

    Thread Starter
    Fanatic Member Black_Storm's Avatar
    Join Date
    Sep 2007
    Location
    any where
    Posts
    577

    Re: i want generate this json array type in vb

    Quote Originally Posted by Arnoutdv View Post
    Have a look in the CodeBank for JSON samples
    can u send a sample about definitaion arrays of my thread #1? my problem is not about json,my problem is about array in array in json and convert in vb.

    can u send code in vb ?

  4. #4
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    5,904

    Re: i want generate this json array type in vb

    I don't send code

  5. #5
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    5,708

    Re: i want generate this json array type in vb

    Dim keyboard
    keyboard = Array("A", "B", "C")




    ..but it works

  6. #6
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,253

    Re: i want generate this json array type in vb

    Quote Originally Posted by Black_Storm View Post
    can u send code in vb ?
    You don't need "special code" for that, because the Telegram-Bot-API is quite simple.

    JSON-responses are (in the end) just Strings.

    So, if you know how to concat Strings in VB6, you can produce the needed JSON-string with relative ease.

    E.g. when you want to show a "userdefined KeyBoard" which is organized like a "NumPad",
    (the keys organized in a 3x4 matrix) - you will have to construct the following String:
    Code:
    {
      "telegram": {
        "text": "type a number",
        "reply_markup": {
          "keyboard": [
            [ "7", "8", "9" ],
            [ "4", "5", "6" ],
            [ "1", "2", "3" ],
            [ "0", ".", "OK"]
          ],
          "one_time_keyboard": true,
          "resize_keyboard": true
        }
      }
    }
    WhiteSpace (vbCrLfs, as well as the indentation per line) are optional - just make sure that
    you keep track of all the braces, commas (and double-qouted double-qutoes) in all the right places)...

    Perhaps Debug.Print your concatenated String-Output first - if you did everything right,
    it should (line by line) basically look like the stuff in the Code-Box above:

    Olaf

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width