Set Alias (SetAlias)

Set Alias (SetAlias)

  • 15 maggio 2012 alle 2:39 pm #21554
    dinesh
    Membro

    Hello,

    I am facing a problem related to alias. I have an Alias Table declared in Screen Properties. and I want to access those aliases in my basic script on calling of a function. So I have written a function:

    ‘function starts here
    Public Function LoadFunctionScreen()
    Dim i As Byte
    For i = 1 To 6
    SetAlias(‘Line’ & i, ‘Display’ & i )
    Next
    End Function

    In this function ‘Line’ is an Alias for a variable ‘Display’
    But i am getting an error while running this code ‘ Expecting an already dimensioned array’ and it points me to the 4th line of the function.

    ‘Small thing I forgot to mention is that, Can I access Alias in MAIN BASIC SCRIPT, instead of object’s(or screen’s) basic script?’

    Thanks in advanced!

  • 16 maggio 2012 alle 9:50 am #21555
    acampagna
    Membro

    Hello Dinesh,

    your last note is the first thing I want to ask you: so your function is declared into a Script Resource Object and not directly into a Screen or Object script.

    The answer is YES, you can reach the Aliases table from a Script resource but you have to reference the desired screen before to call a ‘screen method’ by the script.
    This because the ‘SetAlias’ function is proper of the ‘SynopticCmdTarget’ script interface and you cannot use it as a general function.

    For example you can use this syntax:

    ############

    Sub Main()

        Dim myscreen As SynopticCmdTarget

        Set myscreen = GetSynopticInterface(‘MyScreenName’)

        myscreen.SetAlias(‘Alias’,’VAR00001′)

        Set myscreen = Nothing

    End Sub

    ############

    NOTE: The screen you are referring inside the script MUST be already opened or loaded in RAM. If not, you will receive the error ‘Object Is Nothing’ when you refer the screen object into the script.

    Best Regards,

    Antonio.

  • 16 maggio 2012 alle 1:42 pm #21556
    dinesh
    Membro

    Thank you very much Antonio.

    Yes, you are right. My function is declare in SCRIPT RESOURSE CODE, not in OBJECT or SCREEN SCRIPT CODE.

    I think that’s my answer. The same thing I was trying to do. But It seems ‘GetSynopticInterface()’ is not supported to WinCE. Also i noticed that it works good on my Computer in simulation mode (ALT+F12), but as i download this program in my device it gives me some kind od error.

    Do you suggest me to do same thing but on WinCE platform. I would not mind in case if i have to declare the function in OBJECT or SCREEN script code directly but without using EVENTS since events makes it work slower.

    Regards,

    Dinesh Gosavi.

  • 15 marzo 2019 alle 11:26 am #31542
    Quiaquosmo
    Partecipante

    This will be set with the some information to getting from the chapter of the nuclear chapters to come first as more important. Functions are for the declared by the access of the alias to be confirm from the australianwritings while to unregister of the reduction while catching.

  • 22 marzo 2019 alle 2:07 pm #31658
    Kristof70
    Partecipante

    spam….

Devi essere loggato per rispondere a questa discussione.