Page 2 of 2 FirstFirst 12
Results 11 to 18 of 18

Thread: working with memo fields

  1. #11
    Senior Member
    Join Date
    Oct 2012
    Posts
    125
    hi Barry,
    ...sorry, but the problem is that when something doesnít work or doesnít work the way I want it to, I donít mean a bug at first, but what I messed up or what I do wrong ....
    Now i have a problem with the editbox gadget for example. On the Page, all the Fields in each Section work well (meaning: updated, I can edit, save the data) except the editbox gadget for maintaining the memo field. I can write in it, but the data is not saved when I click the "Save changes" button. (Old content will reappear) ...

  2. #12
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,966
    Hi Strato,

    We would appreciate it if bugs are reported as tickets rather than here which is not tracked by devteam.

    Please provide a small reproducible example so it can be investigated.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  3. #13
    Senior Member
    Join Date
    Oct 2012
    Posts
    125
    Thanks for your help, Barry
    I tried to create a small app (I uploaded the package file and some data records that are on an sql server)
    package
    data
    Last edited by strato; 2020-10-21 at 09:33.

  4. #14
    Senior Member
    Join Date
    Oct 2012
    Posts
    125
    sorry Barry,
    I can already see that the problem was not right here. I slightly modified 2 procedures to show:

    Code:
    function aTest1(theArray)
    	select customerid, contactname from southwind!customers where customerid like "T*" into array theArray 
    endfunc
    
    function aTest2(theStaticArray)
    	=sqleval([select customerid, contactname from southwind!customers where customerid like "T*"])
    	=acopy(_sqlValues,  theStaticArray)
    endfunc
    
    declare aStaticArray[1]
    aTest1(aStaticArray)
    
    ? "atest1"
    ? aStaticArray
    
    declare aStaticArray[1]
    
    ? "atest2"
    aTest2(aStaticArray)
    ? aStaticArray
    Output:
    Code:
    atest1
    Array (refcnt=1)
    (
        [1] = False
    )
    
    atest2
    Array (refcnt=1)
    (
        [1] = False
    )

  5. #15
    Lianja MVP
    Join Date
    Feb 2012
    Location
    Berea, KY, USA
    Posts
    2,010
    Hi Strato,

    You would have to pass the array by reference to get it back filled.

    The more Lianja way would be to return the array as a object from the function. In VFP we had to pass arrays by reference as the array wasn't an object. In Lianja it is an object.

    Hank

  6. #16
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,966
    Hi Strato,

    We would appreciate it if bugs are reported as tickets rather than here which is not tracked by devteam.

    This is not the place to submit tickets.

    Please don't cross post multiple issues on one post, Its confusing as you are not replying in threaded order.

    You were initially asking about memos now you are asking about arrays which is a different topic altogether.


    Last edited by barrymavin; 2020-10-22 at 01:07.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  7. #17
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,966
    Your logic is flawed.

    You are declaring a one dimensional array and trying to fill it with [row, col] values. If you need to fill an existing array do it like this.

    Code:
    function aTest1(theArray)
        select customerid, contactname from southwind!customers where customerid like "T*" into array myArray 
        theArray[1] = myArray
    endfunc
    
    
    function aTest2(theStaticArray)
        =sqleval([select customerid, contactname from southwind!customers where customerid like "T*"])
        theStaticArray[1] = _sqlValues
    endfunc
    
    
    declare aStaticArray[1]
    aTest1(aStaticArray)
    
    
    ? "atest1"
    ? aStaticArray
    
    
    declare aStaticArray[1]
    
    
    ? "atest2"
    aTest2(aStaticArray)
    ? aStaticArray
    Output:

    Code:
    atest1
    Array (refcnt=1)
    (
        [1] = Array
            (
                [1,1] = THEBI
                [1,2] = Liz Nixon                     
                [2,1] = THECR
                [2,2] = Liu Wong                      
                [3,1] = TOMSP
                [3,2] = Karin Josephs                 
                [4,1] = TORTU
                [4,2] = Miguel Angel Paolino          
                [5,1] = TRADH
                [5,2] = Anabela Domingues             
                [6,1] = TRAIH
                [6,2] = Helvetius Nagy                
            )
    )
    
    
    atest2
    Array (refcnt=1)
    (
        [1] = Array
            (
                [1,1] = THEBI
                [1,2] = Liz Nixon                     
                [2,1] = THECR
                [2,2] = Liu Wong                      
                [3,1] = TOMSP
                [3,2] = Karin Josephs                 
                [4,1] = TORTU
                [4,2] = Miguel Angel Paolino          
                [5,1] = TRADH
                [5,2] = Anabela Domingues             
                [6,1] = TRAIH
                [6,2] = Helvetius Nagy                
            )
    )
    
    
    So as you can see you can create arrays and objects within functions and assign them to variables, array elements or object members to make them accessible to the caller.
    Last edited by barrymavin; 2020-10-22 at 03:34.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  8. #18
    Senior Member
    Join Date
    Oct 2012
    Posts
    125

    Thank you very much Barry!
    sorry for the cross topics (in my case, the original select includes a memo field). As I see it, itís really not a bug - donít need a ticket - I just donít know Lianja. (and my English is poor a bit)

Page 2 of 2 FirstFirst 12

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Journey into the Cloud
Join us