Questions Questions 
Author Message
 Questions Questions

1) Does the 'dot' between the following elements have any particular
meaning - Self.Request, Take.Completed etc

2) With the new ABC file loop code do I / can I still use the
SET(FIL:KEY,FIL:KEY) to start file access at a particular point ?

3) If I am going to do some loop coding in a form embed say, do I need to
use any OPEN FILE type statements or can I safely assume that the FORM files
will already be open by default.

4) What is the new form of;
  FIL:KEY=4
  SET(FIL:KEY,FIL:KEY)
  LOOP UNTIL EOF(FIL)
       NEXT(FIL)
       IF FILE:KEYFIELD > 4 THEN BREAK
       FIL:KEYFIELD blah blah
       PUT(FIL)
  .

Do I need to be careful of using PUT, ADD and DELETE within the ABC Code ?

Any help gratefully received.



Sun, 12 Oct 2003 03:53:50 GMT  
 Questions Questions
Malcom,

Quote:
> 1) Does the 'dot' between the following elements have any particular

meaning - Self.Request, Take.Completed etc

YES

Quote:
> 2) With the new ABC file loop code do I / can I still use the
> SET(FIL:KEY,FIL:KEY) to start file access at a particular point ?

YES

Quote:

> 3) If I am going to do some loop coding in a form embed say, do I need to
> use any OPEN FILE type statements or can I safely assume that the FORM
files
> will already be open by default.

YES ( You can safely assume)

Quote:

> 4) What is the new form of;
>   FIL:KEY=4
>   SET(FIL:KEY,FIL:KEY)
>   LOOP UNTIL EOF(FIL)
>        NEXT(FIL)
>        IF FILE:KEYFIELD > 4 THEN BREAK
>        FIL:KEYFIELD blah blah
>        PUT(FIL)

   FIL:KEY=4
   SET(FIL:KEY,FIL:KEY)
   LOOP
        IF NOT Access.MyFile.NEXT() AND Fil:Key = 4
            FIL:KEYFIELD blah blah
            PUT(FIL)
        ELSE
           BREAK
        END

Bernard
San Antonio.



Sun, 12 Oct 2003 04:20:34 GMT  
 Questions Questions

Quote:
> 1) Does the 'dot' between the following elements have any particular
> meaning - Self.Request, Take.Completed etc

HUGE meaning:  here dot represents that right hand side variable is a member
of the left hand side structure. There isn't Take.Completed - it can be
Self.TakeCompleted() - a second meaning in dot-semantic: right hand side
label
is a method of the left hand side structure which must be object (class).

Quote:
> 2) With the new ABC file loop code do I / can I still use the
> SET(FIL:KEY,FIL:KEY) to start file access at a particular point ?

Yes (you have no choice).

Quote:
> 3) If I am going to do some loop coding in a form embed say, do I need to
> use any OPEN FILE type statements or can I safely assume that the FORM
files
> will already be open by default.

In an Update Form Window tables are opened at some point in
ThisWindow.Init();
after that point and the point where they are closed in ThisWindow.Kill()
you can
manipulate the tables.

Quote:
> 4) What is the new form of;
>   FIL:KEY=4
>   SET(FIL:KEY,FIL:KEY)
>   LOOP UNTIL EOF(FIL)
>        NEXT(FIL)
>        IF FILE:KEYFIELD > 4 THEN BREAK
>        FIL:KEYFIELD blah blah
>        PUT(FIL)

 FIL:KEY = 4
 SET(FIL:KEY,FIL:KEY)
 LOOP  WHILE  Access:YourFileLabel.Next()=Level:Benign |
                   AND  FIL:KEY = 4
       FIL:KEYFIELD blah blah
       IF  Access:YourFileLabel.Update()<>Level:Benign
             MESSAGE('Update Failed')
             BREAK  ! If you want to skip further processing
       END
END

Quote:
> Do I need to be careful of using PUT, ADD and DELETE within the ABC Code ?

Avoid them. Use .Access:YourFileLabel.Update(),
.Relate:YourFileLabel.Delete(),
.Access:YourFileLabel.PrimeRecord(), .Access:YourFileLabel.Insert() and
.Access:YourFileLabel.CancelAutoInc()

Quote:
> Any help gratefully received.

Goran Lazic


Sun, 12 Oct 2003 05:26:13 GMT  
 Questions Questions

Quote:
>>1) Does the 'dot' between the following elements have any particular
>>meaning - Self.Request, Take.Completed

Yes it means that Request is a property(ie variable) of the current class.
Self will always refer to the current class.  You could also refer to the
property as ThisWindow.Request and it would be necessary to refer to the
property as such if you wish to refer to it from another class module.
TakeCompleted is actually a method (ie procedure) of various classes and
you would not use the dot between take and completed.  If you wish to call
the method(procedure) from within the same class you would refer to it as
SELF.TakeCompleted() or ThisWindow.TakeCompleted() with the class name in
front of the method.

Quote:
>>2) With the new ABC file loop code do I / can I still use the
>>SET(FIL:KEY,FIL:KEY) to start file access at a particular point ?

Yes see 4.

Quote:
>>3) If I am going to do some loop coding in a form embed say, do I need
to
>>use any OPEN FILE type statements or can I safely assume that the FORM
files
>>will already be open by default.

If the files are in your file list they should be open.  However if you
use LazyOpen you may have to call
Access:Filenmae.UseFile().

Quote:
>>4) What is the new form of;
>>  FIL:KEY=4
>>  SET(FIL:KEY,FIL:KEY)
>>  LOOP UNTIL EOF(FIL)
>>       NEXT(FIL)
>>       IF FILE:KEYFIELD > 4 THEN BREAK
>>       FIL:KEYFIELD blah blah
>>       PUT(FIL)
>>  .

FIL:KEY=4
SET(FIL:KEY,FIL:KEY)
LOOP UNTIL Access:FileName.Next()
  IF FILE:KEYFIELD > 4 THEN BREAK.
  FIL:KEYFIELD blah blah
  Access:FileName.Update()
END

Quote:
>>Do I need to be careful of using PUT, ADD and DELETE within the ABC Code

?
Yes You should the ABC methods
  PUT  Access:FileName.Update()
  ADD  Access:FileName.Insert()
  DELETE   Relate:FileName.Delete()

You must use the RelationManager class to delete a record to ensure the
relationship constraints are followed.

Good Luck

Dave Potter

Any help gratefully received.



Sun, 12 Oct 2003 04:48:27 GMT  
 Questions Questions
Hi Malcolm,

On Tue, 24 Apr 2001 20:53:50 +0100, "Malcolm Hind"

Quote:

>1) Does the 'dot' between the following elements have any particular
>meaning - Self.Request, Take.Completed etc

Yes.  This is what is called a "dot-syntax"   I stumbled on a quick
and dirty explanation after searching in Yahoo at:

http://www.robotduck.com/learning/basics/dot_syntax/dot_syntax02.htm

"you could think of the dot as being an indication of what is
attatched to what - it indicates that the item after the dot is
'attached to' or 'owned by' by the item before the dot. This is the
concept of a property - a piece of information attached to an object."

In Clarion you normally use this with Methods/Properties of objects
(Classes) but also for complex data structures such as groups:

MyGroup  Group
MyVar      Long
         End

you can use as:

 MyGroup.MyVar = 1

or queues:

MyQueue   Queue
MyLong      Long
MyStr       String(10)
          End

 MyQueue.MyLong = 1
 MyQueue.MyStr  = 'Arnor'
 Add(MyQueue)
 Sort(MyQueue,MyQueue.MyLong)
 Sort(MyQueue,-MyQueue.MyStr)

You can also use this with files/fields, something like:

 MYF:Record.MyField = 1

etc.  See further in help for Who, What, Where as well as Class etc.

Quote:
>2) With the new ABC file loop code do I / can I still use the
>SET(FIL:KEY,FIL:KEY) to start file access at a particular point ?

Yes - same thing exactly.

Quote:
>3) If I am going to do some loop coding in a form embed say, do I need to
>use any OPEN FILE type statements or can I safely assume that the FORM files
>will already be open by default.

Depends.  If you have the global check for "Defer opening files until
used" checked, the file will not be actually opened until it's used.
Thing to do is to use:

 Access:MyFile.UseFile

before you do file access - that makes sure the file is actually
opened (sets it up for use)

Quote:
>4) What is the new form of;
>  FIL:KEY=4
>  SET(FIL:KEY,FIL:KEY)
>  LOOP UNTIL EOF(FIL)
>       NEXT(FIL)
>       IF FILE:KEYFIELD > 4 THEN BREAK
>       FIL:KEYFIELD blah blah
>       PUT(FIL)
>  .

Could be something like:

 Access:Fil.ClearKey(FIL:KEY) ! Clears all keyfields
 ! If you don't want to clear all keyfields, then simply don't:)
 FIL:Key = 4
 Set(FIL:Key,FIL:Key)
 Loop
   If Access:Fil.Next()
     Break
   End
   If FIL:Key > 4
     Break
   End
   Fil:Key = 0
   If Access:Fil.Update
     Message('Could not update record')
   End
 End

Quote:
>Do I need to be careful of using PUT, ADD and DELETE within the ABC Code ?

Put = Access:FileLabel.Update or Access:FileLabel.TryUpdate
Add = Access:FileLabel.Insert or Access:FileLabel.TryInsert

Delete you _can_ use on files that have no relationships defined, but
I'd reccomend using Relate:FileLabel.Delete instead as it will force
updates to child files according to the relationsal constrains set in
the dictionary.

Best regards,



Sun, 12 Oct 2003 04:51:52 GMT  
 Questions Questions
Hi All,

Someone should put this in the FAQ listing on the SV web site.  I was
looking for this just last night and to find examples of all of the
combinations, they are scattered all over in the docs.  Bits here and bits
there etc...

It should ALSO be in the on-line-help with examples like are shown here.

--
Regards,
Earl R. Coker
Buy the System, Gain the Knowledge.
Sales and Business Management Systems.
www.kwiksystems.com


Quote:
> 1) Does the 'dot' between the following elements have any particular
> meaning - Self.Request, Take.Completed etc

> 2) With the new ABC file loop code do I / can I still use the
> SET(FIL:KEY,FIL:KEY) to start file access at a particular point ?

> 3) If I am going to do some loop coding in a form embed say, do I need to
> use any OPEN FILE type statements or can I safely assume that the FORM
files
> will already be open by default.

> 4) What is the new form of;
>   FIL:KEY=4
>   SET(FIL:KEY,FIL:KEY)
>   LOOP UNTIL EOF(FIL)
>        NEXT(FIL)
>        IF FILE:KEYFIELD > 4 THEN BREAK
>        FIL:KEYFIELD blah blah
>        PUT(FIL)
>   .

> Do I need to be careful of using PUT, ADD and DELETE within the ABC Code ?

> Any help gratefully received.



Sun, 12 Oct 2003 05:20:51 GMT  
 Questions Questions
Thank you all for all the help !


Quote:


> > 1) Does the 'dot' between the following elements have any particular
> > meaning - Self.Request, Take.Completed etc

> HUGE meaning:  here dot represents that right hand side variable is a
member
> of the left hand side structure. There isn't Take.Completed - it can be
> Self.TakeCompleted() - a second meaning in dot-semantic: right hand side
> label
> is a method of the left hand side structure which must be object (class).

> > 2) With the new ABC file loop code do I / can I still use the
> > SET(FIL:KEY,FIL:KEY) to start file access at a particular point ?

> Yes (you have no choice).

> > 3) If I am going to do some loop coding in a form embed say, do I need
to
> > use any OPEN FILE type statements or can I safely assume that the FORM
> files
> > will already be open by default.

> In an Update Form Window tables are opened at some point in
> ThisWindow.Init();
> after that point and the point where they are closed in ThisWindow.Kill()
> you can
> manipulate the tables.

> > 4) What is the new form of;
> >   FIL:KEY=4
> >   SET(FIL:KEY,FIL:KEY)
> >   LOOP UNTIL EOF(FIL)
> >        NEXT(FIL)
> >        IF FILE:KEYFIELD > 4 THEN BREAK
> >        FIL:KEYFIELD blah blah
> >        PUT(FIL)

>  FIL:KEY = 4
>  SET(FIL:KEY,FIL:KEY)
>  LOOP  WHILE  Access:YourFileLabel.Next()=Level:Benign |
>                    AND  FIL:KEY = 4
>        FIL:KEYFIELD blah blah
>        IF  Access:YourFileLabel.Update()<>Level:Benign
>              MESSAGE('Update Failed')
>              BREAK  ! If you want to skip further processing
>        END
> END

> > Do I need to be careful of using PUT, ADD and DELETE within the ABC Code
?

> Avoid them. Use .Access:YourFileLabel.Update(),
> .Relate:YourFileLabel.Delete(),
> .Access:YourFileLabel.PrimeRecord(), .Access:YourFileLabel.Insert() and
> .Access:YourFileLabel.CancelAutoInc()

> > Any help gratefully received.

> Goran Lazic



Sun, 12 Oct 2003 05:47:29 GMT  
 Questions Questions
On Tue, 24 Apr 2001 20:53:50 +0100, "Malcolm Hind"

Quote:

>Do I need to be careful of using PUT, ADD and DELETE within the ABC Code ?

  What they said, but Note: The objects do not always have a method
that is the equivilent to the language call, there is no
Filemanager.Set() method. Look in the list of methods and if you do
not find the function then use the old form.

  I think this is a little confusing, it might be a good idea in the
next version to add the missing methods even if they just call the old
form of the function. I don't think that would break any existing
code.

 Carl



Mon, 13 Oct 2003 01:18:00 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. Questions-Questions-Questions-Answers-Answers

2. Question(Questions, questions...)

3. questions, questions!

4. Questions, questions!

5. LOGO-L> Questions-Questions-Questions-Answers-Answers

6. Newbie Question: Realbasic Question

7. Questions and more questions...

8. Browse Question / Report question

9. ***Data buffering question. Long post, lots of questions

10. MicroWorlds Pro "QUESTION Set Size" question

11. OS/2 REXX Question (Object REXX Question Inside)

12. Doc question and Mount question

 

 
Powered by phpBB® Forum Software