Jump to content

Photo

Which are the essential scripts nowadays?


  • Please log in to reply
17 replies to this topic

#16 vaualbus

vaualbus

    Experienced Forumer

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

Posted 03 October 2017 - 12:34 AM

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



#17 ZoriaRPG

ZoriaRPG

    ZC Contributor & Wiki Editor

  • Members
  • Gender:Unspecified
  • Location:Prydon Academy

Posted 03 October 2017 - 03: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

    Experienced Forumer

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

Posted 03 October 2017 - 07: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