Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Jose F Zouain" Newsgroups: comp.lang.clipper.visual-objects Subject: Re: Help on saving an array element to table Date: 28 May 2017 00:54:04 GMT Lines: 67 Message-ID: References: <17388e2a-c82a-4d20-bf53-8afffcc994f5@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 X-Trace: individual.net vxJGgviKtyPO134lHFydHAPQ4tJJvLWAh1KepnlKtfNzahmzWP Cancel-Lock: sha1:SHaGrNigQHDqXufSerGs6yHfV/4= User-Agent: XanaNews/1.18.1.5 Xref: csiph.com comp.lang.clipper.visual-objects:10613 Hi Guys Thanks all for responding. I am using a combo box with Fillusing, at the screen display is working good, we load the first element of the array and user selects it. The problem is saving it to the table. Already have in memory the element selected, let's say Sales Order. Now want to save in column "SO", a character(2) column Phil Thanks don't want to use Memo field, is already a character (2) column. Franz n := AScan(aTranscod, {|aVal| aVal[1] == "Sales Order"}) This code is working, no compling error Returns n==0 So when saving it crashes Steve This search I did is incorrect n := AScan(aTranscod, SELF:oDCTRANSCOD:TextValue) Have to search for first element in the array and save the correspoding 2nd element. Steve When I compile this, gives me an error: Bad function call 51138 n := ascan(aTranscod,{|aTranscod|aTranscod[1] = SELF:oDCTRANSCOD:TextValue}) I just replaced = SELF:oDCTRANSCOD:TextValue}) with = Sales Order}) and it worked because I selected Sales Order from the Combo Box. Now I know where the problem is at SELF:oDCTRANSCOD:TextValue But when I displayed it at the screen is correct: SELF:oDCTRANSCOD:TextValue == "Sales Order" Johan Thanks, but I have the same error as above -> Bad function call 51138 But for testing it will not crash, because of this: IF n > 0 SELF:oDBServer:FIELDPUT(#TRANSCOD, aTranscod[n,2]) ENDIF ============================= I just did a workaround don't know if is correct, but is working now replaced the SELF:oDCTRANSCOD:TextValue like this LOCAL sValue AS STRING sValue := SELF:oDCTRANSCOD:TextValue n := AScan(aTranscod,{|aTranscod|aTranscod[1] == sValue}) and is saving it OK, looks like the ascan doesn't like to compare with SLE value Thanks all for your help, this why I have not left VO, because of the help you all guys provides here. Please let me know if this OK, what I did. Best regards Jose --