Project

General

Profile

Start.java

Andreea Bârzu, 11/08/2024 06:36 AM

Download (1.47 KB)

 
1
package com.goldencode.dataset;
2

    
3
import com.goldencode.p2j.util.*;
4
import com.goldencode.dataset.ui.*;
5
import com.goldencode.p2j.ui.*;
6
import com.goldencode.p2j.persist.*;
7
import com.goldencode.dataset.dmo.fwd.*;
8
import com.goldencode.p2j.persist.lock.*;
9

    
10
import static com.goldencode.p2j.util.BlockManager.*;
11
import static com.goldencode.p2j.util.InternalEntry.Type;
12
import static com.goldencode.p2j.ui.LogicalTerminal.*;
13

    
14
/**
15
 * Business logic (converted to Java from the 4GL source code
16
 * in start.p).
17
 */
18
@DatabaseReferences(aliases = 
19
{
20
   "fwd"
21
}, tables = 
22
{
23
   "fwd.t1"
24
})
25
public class Start
26
{
27
   public static final String FMT_STR_1 = "->,>>>,>>9";
28

    
29
   T1.Buf t1Buff = RecordBuffer.define(T1.Buf.class, "fwd", "t1Buff", "t1_buff");
30

    
31
   T1.Buf t1 = RecordBuffer.define(T1.Buf.class, "fwd", "t1", "t1");
32

    
33
   StartInvacc invaccFrame = GenericFrame.createFrame(StartInvacc.class, "invacc");
34

    
35
   @LegacySignature(type = Type.VARIABLE, name = "copy_f1")
36
   integer copyF1 = TypeFactory.integer((long) 0);
37

    
38
   /**
39
    * External procedure (converted to Java from the 4GL source code
40
    * in start.p).
41
    */
42
   @LegacySignature(type = Type.MAIN, name = "start.p")
43
   public void execute()
44
   {
45
      externalProcedure(Start.this, new Block((Body) () -> 
46
      {
47
         invaccFrame.openScope();
48
         RecordBuffer.openScope(t1);
49
         new FindQuery(t1, (String) null, null, "t1.recid asc", LockType.NONE).unique();
50
         copyF1.assign(t1.getF1());
51
         message(copyF1);
52
      }));
53
   }
54
}