Alaska Software Inc. - xbase skips some like of codes...
Username: Password:
AuthorTopic: xbase skips some like of codes...
Marcelo Ramosxbase skips some like of codes...
on Wed, 27 Oct 2004 12:24:07 -0400
HI there guys,

    I'm having a weird problem and I don't have a clue what's wrong w/ it..
    I have the following piece of code:


***************************************************
Function add_note(srch_key)
 local rlst:=.f.

 if add_rec(5)
  rlst:=.t.
  Note_pad->Dbf_name  := substr(srch_key, 1, 8)
  Note_pad->Srch_key  := substr(srch_key, 9)
  unlock_rec()
 endif

return(rlst)

****************************************************

    When i run it on debug mode it just SKIPS the lines where I have
the reference to the database ("note_pad->")  like they don't exist...
    I already tried to change the variable name to another name, tried
to remove the Column from the attribution etc.. and it doesn't execute
that like.. The only way I have that to work is if I use the Summer 97
command "REPLACE WITH".. But please dont tell me that thats the
only way its going to work because i have 90% of the program using
:= instead of REPLACE WITH.. :D

    Did someone had the same problem ?!?!

PS: I'm using xBase 1.80 w/ ADSBDE 1.8


Thanks a lot!
Marcelo
Phil Ide
Re: xbase skips some like of codes...
on Wed, 27 Oct 2004 18:10:02 +0100
Marcelo,

>  if add_rec(5)
>   rlst:=.t.
>   Note_pad->Dbf_name  := substr(srch_key, 1, 8)
>   Note_pad->Srch_key  := substr(srch_key, 9)
>   unlock_rec()
>  endif
> 
> return(rlst)
> 
> ****************************************************
> 
>     When i run it on debug mode it just SKIPS the lines where I have
> the reference to the database ("note_pad->")  like they don't exist...
>     I already tried to change the variable name to another name, tried
> to remove the Column from the attribution etc.. and it doesn't execute
> that like.. The only way I have that to work is if I use the Summer 97
> command "REPLACE WITH".. But please dont tell me that thats the
> only way its going to work because i have 90% of the program using
>:= instead of REPLACE WITH.. :D

No, the following code:

  REPLACE x WITH y

..is pre-processed into:

  FIELD->x := y


You could try replacing references to Note_pad-> with FIELD-> and see if
that makes a difference (in your code, the alias is not strictly necessary
because the current workarea is the one you are writing to, but using
"FIELD->" will help avoid compiler warnings).

Regards,

Phil Ide

***************************************
* Xbase++ FAQ, Libraries and Sources: *
* goto: http://www.idep.org.uk/xbase  *
***************************************

If marriage is outlawed, only outlaws will have inlaws.
Marcelo RamosRe: xbase skips some like of codes...
on Thu, 28 Oct 2004 09:39:34 -0400
HI Phil, first of all thanks for the reply!

    I got one question on that, the FIELD-> will only work if I have the
workarea that I'm writting to is selected (if i previously used: "Select
note_pad") right? otherwise it wont work because it
wont find the field on the other selected area..
    Another question.. WHY that happens? how can I spot that, since it
doesn't give me any error or anything? Is there as special argument I would
pass to the builder to make it crash or
point if that case happens?
    The only reason i foudn that this part is not working is because the
whole function that takes care of the "note_pad" stopped working too (same
skipping reason.. but when i call the function - ex. ShowNotePad() )

Thanks a lot!
Marcelo

"Phil Ide" <phil@idep.org.uk> wrote in message
news:1d2cq6zdbrjqj$.dlg@idep.org.uk...
> Marcelo,
>
> >  if add_rec(5)
> >   rlst:=.t.
> >   Note_pad->Dbf_name  := substr(srch_key, 1, 8)
> >   Note_pad->Srch_key  := substr(srch_key, 9)
> >   unlock_rec()
> >  endif
> >
> > return(rlst)
> >
> > ****************************************************
> >
> >     When i run it on debug mode it just SKIPS the lines where I have
> > the reference to the database ("note_pad->")  like they don't exist...
> >     I already tried to change the variable name to another name, tried
> > to remove the Column from the attribution etc.. and it doesn't execute
> > that like.. The only way I have that to work is if I use the Summer 97
> > command "REPLACE WITH".. But please dont tell me that thats the
> > only way its going to work because i have 90% of the program using
> >:= instead of REPLACE WITH.. :D
>
> No, the following code:
>
>   REPLACE x WITH y
>
> ..is pre-processed into:
>
>   FIELD->x := y
>
>
> You could try replacing references to Note_pad-> with FIELD-> and see if
> that makes a difference (in your code, the alias is not strictly necessary
> because the current workarea is the one you are writing to, but using
> "FIELD->" will help avoid compiler warnings).
>
> Regards,
> -- 
> Phil Ide
>
> ***************************************
> * Xbase++ FAQ, Libraries and Sources: *
> * goto: http://www.idep.org.uk/xbase  *
> ***************************************
>
> If marriage is outlawed, only outlaws will have inlaws.
Phil Ide
Re: xbase skips some like of codes...
on Thu, 28 Oct 2004 16:30:21 +0100
Marcelo,

>     I got one question on that, the FIELD-> will only work if I have the
> workarea that I'm writting to is selected (if i previously used: "Select
> note_pad") right? otherwise it wont work because it
> wont find the field on the other selected area..

I assumed you had already selected the workarea from your sample code which
doesn't alias the add_rec() or unlock_rec() functions:

 if add_rec(5)
  rlst:=.t.
  Note_pad->Dbf_name  := substr(srch_key, 1, 8)
  Note_pad->Srch_key  := substr(srch_key, 9)
  unlock_rec()
 endif

It could be that there is a conflict with variables which exist within the
debugger (although I doubt it).

Regards,

Phil Ide

***************************************
* Xbase++ FAQ, Libraries and Sources: *
* goto: http://www.idep.org.uk/xbase  *
***************************************

If ET married Peter Cetera he'd be ET CETERA.
Marcelo RamosRe: xbase skips some like of codes...
on Fri, 29 Oct 2004 09:13:53 -0400
Hi Phil,

     I seem to have found a bug w/ xBase (at least v1.80)
    Seems like everytime you use a variable/database name that starts w/
"NOTE_"
it wont recognize it in many cases. I'm opening a new thread w/ this
question and
posting a sample code in case you want to follow it up.

    Well anyways thanks a lot for the help!

Kind regards,
Marcelo

"Phil Ide" <phil@idep.org.uk> wrote in message
news:c5wyivut019i$.dlg@idep.org.uk...
> Marcelo,
>
> >     I got one question on that, the FIELD-> will only work if I have the
> > workarea that I'm writting to is selected (if i previously used: "Select
> > note_pad") right? otherwise it wont work because it
> > wont find the field on the other selected area..
>
> I assumed you had already selected the workarea from your sample code
which
> doesn't alias the add_rec() or unlock_rec() functions:
>
>  if add_rec(5)
>   rlst:=.t.
>   Note_pad->Dbf_name  := substr(srch_key, 1, 8)
>   Note_pad->Srch_key  := substr(srch_key, 9)
>   unlock_rec()
>  endif
>
> It could be that there is a conflict with variables which exist within the
> debugger (although I doubt it).
>
> Regards,
> -- 
> Phil Ide
>
> ***************************************
> * Xbase++ FAQ, Libraries and Sources: *
> * goto: http://www.idep.org.uk/xbase  *
> ***************************************
>
> If ET married Peter Cetera he'd be ET CETERA.
Andreas Gehrs-Pahl
Re: xbase skips some like of codes...
on Wed, 27 Oct 2004 14:01:50 -0400
Marcelo,

>When i run it on debug mode it just SKIPS the lines where I have
>the reference to the database ("note_pad->") like they don't exist...

The most likely reason for this problem is that your Source Code does not 
belong to the compiled (debugged) executable. This would happen if your 
(new) code has some error somewhere, and the compiler (or linker) did not 
create a new executable, and the old source code file had no executable code 
in those two lines. Delete your executable (and *.ppo and *.obj files) and 
compile/link. I suspect that you will find the error then.

-- Andreas

---                                                                      ---
  Andreas Gehrs-Pahl              E-Mail: GPahl@CharterMI.net
  415 Gute Street                     or: Andreas@DDPSoftware.com
  Owosso, MI 48867-4410               or: Andreas@Aerospace-History.net
  Tel: (989) 723-9927           Web Site: http://www.Aerospace-History.net
---                                                                      ---
Marcelo RamosRe: xbase skips some like of codes...
on Thu, 28 Oct 2004 09:29:36 -0400
Hi Andreas,

    If thats the case, why when I change the code to REPLACE WITH (or add an
alert) it works (executes the new code) AND I see the code on the debug
mode?

Thanks,
[]s
Marcelo


"Andreas Gehrs-Pahl" <Andreas@DDPSoftware.com> wrote in message
news:1sfts474o73x4.1n1nmb7gb4akr.dlg@40tude.net...
> Marcelo,
>
> >When i run it on debug mode it just SKIPS the lines where I have
> >the reference to the database ("note_pad->") like they don't exist...
>
> The most likely reason for this problem is that your Source Code does not
> belong to the compiled (debugged) executable. This would happen if your
> (new) code has some error somewhere, and the compiler (or linker) did not
> create a new executable, and the old source code file had no executable
code
> in those two lines. Delete your executable (and *.ppo and *.obj files) and
> compile/link. I suspect that you will find the error then.
>
> -- Andreas
>
> ---                                                                      -
--
>   Andreas Gehrs-Pahl              E-Mail: GPahl@CharterMI.net
>   415 Gute Street                     or: Andreas@DDPSoftware.com
>   Owosso, MI 48867-4410               or: Andreas@Aerospace-History.net
>   Tel: (989) 723-9927           Web Site: http://www.Aerospace-History.net
> ---                                                                      -
--
Mark BloomfieldRe: xbase skips some like of codes...
on Fri, 05 Nov 2004 23:08:34 +1100
I read in a thread somewhere where note_ are preprocessed as the old dbnase
style note command ( like  or /* */)
Theres a PDR that fixes this problem with the compiler.

See the thread called "The compiler skip code lines started with note_" in
the new.xbase convo. I think the PDR is

 this problem is know under PDR 5245, you can get a hotfix from
 Technical Support upon request. Please send email to
support@alaska-software.com
 requesting hotfix for PDR 5245.


Regards,
Mark Bloomfield


"Marcelo Ramos" <mramos@caisoftdesign.ca> wrote in message
news:$jU5QEEvEHA.8060@S15147418...
> HI there guys,
>
>     I'm having a weird problem and I don't have a clue what's wrong w/
it..
>     I have the following piece of code:
>
>
> ***************************************************
> Function add_note(srch_key)
>  local rlst:=.f.
>
>  if add_rec(5)
>   rlst:=.t.
>   Note_pad->Dbf_name  := substr(srch_key, 1, 8)
>   Note_pad->Srch_key  := substr(srch_key, 9)
>   unlock_rec()
>  endif
>
> return(rlst)
>
> ****************************************************
>
>     When i run it on debug mode it just SKIPS the lines where I have
> the reference to the database ("note_pad->")  like they don't exist...
>     I already tried to change the variable name to another name, tried
> to remove the Column from the attribution etc.. and it doesn't execute
> that like.. The only way I have that to work is if I use the Summer 97
> command "REPLACE WITH".. But please dont tell me that thats the
> only way its going to work because i have 90% of the program using
> := instead of REPLACE WITH.. :D
>
>     Did someone had the same problem ?!?!
>
> PS: I'm using xBase 1.80 w/ ADSBDE 1.8
>
>
> Thanks a lot!
> Marcelo
>
>