Πέμπτη 25 Μαΐου 2023

Revision 31, Version 12

 All bugs removed; GreekManual.pdf updated (all programs checked)..


Fixed one line problem on pipe thread (so now run as expected)

\\ Server - Client in one module
\\ The easy way. ALFA$ is cleared
\\ L=12345   \\ here we use an auto thread number.
USE PIPE TO ALFA$ AS L
PIPE PIPENAME$(L),"George",2,3
WHILE ALFA$="" {
      IF MOUSE THEN BREAK   \\EXIT FROM MODULE
      WAIT 10
      PRINT "Wait..."
}
STACK ALFA$ : DROP 2 \\ drop pipe name and match string
READ A$, A, B
PRINT A$, A, B
THREAD L ERASE
THREADS

Fixed an old bug: When we merge an object with another, we expect the final object to handle private properly. The Group C as part of beta class has to read private x from parent, using the proper link statement, The following  example now run as expected. Some earlier versions also works, but from version 11, middle revisions that broken. This example founded as Greek version on GreekManual. This show how to add temporary functionality to an object. The easiest way is to use a function and not a group which is one level down from objects first level members. Using a function we don't have to use the link statement for the previous level (this can be used only on functions/modules which are members of an object, which is member of an object (as compound object, not by inheritance, and not by a pointer, this object is part of the host object, and is read only, as executable object, and we can add more functions/modules/members/events)

class alfa {
private:
    x=1234
public:
    module ShowX {
        Print .x
    }
}
class beta {
    k=30
    group c {
        value {
            link parent x to x
            =x
            x++
        }
    }
}
m=alfa()


module tstA (&z) {

    // attach beta class on z, where z.c get private z.x (which is )
    // z has own list, so the m hold integrity of own list of members
    z=beta()
    Print z.c // should be 1234  and private x change to 1235. which part of m
}
// pass by reference
tstA &m
// c not exit in m
Print Valid(m.c)=false // should be True
m.ShowX  // should be 1235

Δεν υπάρχουν σχόλια:

Δημοσίευση σχολίου

You can feel free to write any suggestion, or idea on the subject.