3. Februar 2010 16:32
OBJECT Codeunit 50000 Client Version
{
OBJECT-PROPERTIES
{
Date=03.02.10;
Time=12:00:00;
Modified=No;
Version List=TOOLS;
}
PROPERTIES
{
TableNo=2000000026;
OnRun=VAR
Text@1000000000 : Text[1024];
BEGIN
CASE Number OF
5 :
BEGIN
Text := GETLASTERRORTEXT;
END;
END;
END;
}
CODE
{
PROCEDURE GetClientVersion@1() : Integer;
BEGIN
IF TestVersion6 THEN
EXIT(600);
IF TestVersion5 THEN
EXIT(500);
IF TestVersion4 THEN
EXIT(400);
EXIT(370);
END;
LOCAL PROCEDURE TestVersion4@4() : Boolean;
VAR
Object@1000000000 : Record 2000000001;
BEGIN
EXIT(EVALUATE(Object.Type, 'Menu'));
END;
LOCAL PROCEDURE TestVersion5@5() : Boolean;
VAR
Int@1000000001 : Record 2000000026;
BEGIN
Int.Number := 5;
EXIT(CODEUNIT.RUN(CODEUNIT::"Client Version", Int));
END;
LOCAL PROCEDURE TestVersion6@6() : Boolean;
VAR
Object@1000000000 : Record 2000000001;
BEGIN
EXIT(EVALUATE(Object.Type, 'Page'));
END;
BEGIN
END.
}
}
3. Februar 2010 18:08
OBJECT Codeunit 50000 ClientVersionMgt
{
OBJECT-PROPERTIES
{
Date=03.02.10;
Time=19:00:00;
Modified=Yes;
Version List=TOOLS;
}
PROPERTIES
{
TableNo=2000000026;
OnRun=VAR
Object@1000000001 : Record 2000000001;
BEGIN
CASE Number OF
3 :
BEGIN
IF CURRENTDATETIME = CURRENTDATETIME THEN ;
END;
4 :
BEGIN
EVALUATE(Object.Type, 'Menu');
END;
5 :
BEGIN
IF GETLASTERRORTEXT = '' THEN ;
END;
6 :
BEGIN
EVALUATE(Object.Type, 'Page');
END;
ELSE
ERROR('');
END;
END;
}
CODE
{
VAR
ClientVersion@1000000000 : Integer;
PROCEDURE Init@1000000000();
BEGIN
IF ClientVersion <> 0 THEN
EXIT;
ClientVersion := AnalyseClientVersion;
END;
PROCEDURE GetClientVersion@1() : Integer;
BEGIN
Init;
EXIT(ClientVersion);
END;
LOCAL PROCEDURE AnalyseClientVersion@1000000002() : Integer;
BEGIN
CASE TRUE OF
TestVersion(6) : EXIT(600);
TestVersion(5) : EXIT(500);
TestVersion(4) : EXIT(400);
TestVersion(3) : EXIT(370);
ELSE
EXIT(260);
END;
END;
LOCAL PROCEDURE TestVersion@1000000008(Version@1000000000 : Integer) : Boolean;
VAR
Int@1000000001 : Record 2000000026;
BEGIN
Int.Number := Version;
EXIT(CODEUNIT.RUN(CODEUNIT::ClientVersionMgt, Int));
END;
BEGIN
END.
}
}