Jump to content

Photo

Which are the essential scripts nowadays?


  • Please log in to reply
17 replies to this topic

#16 vaualbus

vaualbus

    Junior

  • Members
  • Real Name:Alberto
  • Location:Turin, Italy

Posted 03 October 2017 - 01:34 AM

I would like pointer for passing arguments in function by reference and menage array in a easier way



#17 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 03 October 2017 - 04:57 AM

I would like pointer for passing arguments in function by reference and menage array in a easier way


Better arrayy stuff is in the works.

IDK what you want to do with pointers, but this is already legal:

int arr[20];
ffc script a{
    void run(){
        int x =getffX(this); //pass the pointer for this ffc to the function.
        setIndex(arr, 2, x): //uses the pointyer to array *arr
        this->Y = getIndex(arr, 2+x);// also uses the pointer of *arr
    }
    int getIndex(int ptr, int inx){ return ptr[inx];
    void setIndex(int ptr, int inx, int v){ ptr[inx] = v;}
    int getffX(ffc f){ return f->X;)
}


#18 vaualbus

vaualbus

    Junior

  • Members
  • Real Name:Alberto
  • Location:Turin, Italy

Posted 03 October 2017 - 08:07 AM

Better arrayy stuff is in the works.
IDK what you want to do with pointers, but this is already legal:

int arr[20];
ffc script a{
    void run(){
        int x =getffX(this); //pass the pointer for this ffc to the function.
        setIndex(arr, 2, x): //uses the pointyer to array *arr
        this->Y = getIndex(arr, 2+x);// also uses the pointer of *arr
    }
    int getIndex(int ptr, int inx){ return ptr[inx];
    void setIndex(int ptr, int inx, int v){ ptr[inx] = v;}
    int getffX(ffc f){ return f->X;)
}

Oh thanks i completely did nit know you can do that. So basically int p can either p an integer or an array.


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users