• shoesman
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 6
    Replies

hi all,

 

Could someone kindly advise me the below, :smileysad:

 

I have just start coding apex, and am currently trying to develop "math drill application",

but I have completely no idea how to show the array data in visualforce.

 

-----------------------------------

Apex class)

 

Integer [] a = new Integer[2];
       a[0] = 10;
       a[1] = 2;
       a[2] =(a[0]+a[1]);
       return a;

------------------------------------

this is an example of apex class I code, I hope this formula should be alright...

if I want to show this array data "a" in visualforce, how do you code that ????

 

Formula of apex class maybe alright but if its in Java, it should be "system.out.println(a[0]+a[1]);",

but its not accepeted in apex class (Ive got a error when I save it.....) ,therefore I code like "return (value)",

 

---------------------------

Visualforce)

 

{!a[0]}+{![1]}={![2]}

---------------------------

this is the one I code in visualforce, off course, it doesnt work. 


 

There are no information in developper's guide, so could someone advise me with an example???

 

thanks :smileyindifferent:

hi,

 

Ive got this erroe but I have no idea why I got this, 

 

the apex class is 

 

----------------------

Integer R = math.mod(ran1,ran2);     

Integer d = (ran1/ran2);

public Integer getDivideNumber() {
      if (R!=0) {   
          continue;  
          }else{
      return d;
      break;
   }

}

----------------------

 

Whant I am trying is that I dont want to have remainder, I would like to have only the answer by dividing.

But it seems its looping,  do some have any idea to solve this issue ????

 

 :mansad::smileysad:

 

hi

 

Could some advice me how to write "for loop" in apex code, 

I know "for loop" is very basic thing but I don know I cant make it.....

 

this is copy of my controller

 

-----------------------------------------------------------

public double getRandomNumber() {        
     for (double i = 0, j = 0; i < 10; i++) {
     double ran =Math.round(Math.random()*100);
   
     return ran(i+1);   
     }

-----------------------------------------------------------

 

I know I can do it one by one, but using "for loop" should be better for my study

 

please kindly show me how to make it ?:smileysad::smileysurprised::smileysad:

 

thanks

 

Hi

 

I am making Mathmatics drill, and writing the code like below, 

 

 {!RandomNumber1} + {!RandomNumber2} = X(value)

 

As you can see it, I want to show only QUESTIONS in Visualforce page, not ANSWER.

 

What I am thinking about is once I clicked the button, the answer comes out.

But if I write "X" there, the answer will be shown in this page.

 

So it would be great to pass the value from this page to another page....

 

Is that possible, if so please kindly advise me...

 

 

Thanks

hi all,

 

This is my second posting, please kindly advise me :smileysad:

 

Anyway, what I am trying to make is "math drill", which simply shows like

 

12+3 =

24-9  =

3 *4  =

 

I have code above in javascript, and I want those caluculation to be run by Apex controller,

but I can't figure out how to pass the value from javascript to Apex controller.

 

I have looked for other discussion bords no information found out:<

(this page can be simillar but no exaple on it http://community.salesforce.com/sforce/board/message?board.id=apex&thread.id=13138)

 

I really want to study this so please kindly advise me.....

 

thanks:smileysad:

hi all,

  

I just wanna ask you how call apex class from visualforce.

Acually, I am trying to do is like "math drill" (good for start-up programming ?) ,

 

it shows some questions in visualforce like,

 

3+4 =

5*4 =

12-3=

and when the button has been clicked, answers comes up.

 

 


But I have totally no idea how to call this class and show it in visualforce.

 

I am just a beginner, I just have start using force.com yesterday.

 

 

Thanks:smileysad:,

 

 

hi,

 

Ive got this erroe but I have no idea why I got this, 

 

the apex class is 

 

----------------------

Integer R = math.mod(ran1,ran2);     

Integer d = (ran1/ran2);

public Integer getDivideNumber() {
      if (R!=0) {   
          continue;  
          }else{
      return d;
      break;
   }

}

----------------------

 

Whant I am trying is that I dont want to have remainder, I would like to have only the answer by dividing.

But it seems its looping,  do some have any idea to solve this issue ????

 

 :mansad::smileysad:

 

hi

 

Could some advice me how to write "for loop" in apex code, 

I know "for loop" is very basic thing but I don know I cant make it.....

 

this is copy of my controller

 

-----------------------------------------------------------

public double getRandomNumber() {        
     for (double i = 0, j = 0; i < 10; i++) {
     double ran =Math.round(Math.random()*100);
   
     return ran(i+1);   
     }

-----------------------------------------------------------

 

I know I can do it one by one, but using "for loop" should be better for my study

 

please kindly show me how to make it ?:smileysad::smileysurprised::smileysad:

 

thanks

 

Hi

 

I am making Mathmatics drill, and writing the code like below, 

 

 {!RandomNumber1} + {!RandomNumber2} = X(value)

 

As you can see it, I want to show only QUESTIONS in Visualforce page, not ANSWER.

 

What I am thinking about is once I clicked the button, the answer comes out.

But if I write "X" there, the answer will be shown in this page.

 

So it would be great to pass the value from this page to another page....

 

Is that possible, if so please kindly advise me...

 

 

Thanks

hi all,

 

This is my second posting, please kindly advise me :smileysad:

 

Anyway, what I am trying to make is "math drill", which simply shows like

 

12+3 =

24-9  =

3 *4  =

 

I have code above in javascript, and I want those caluculation to be run by Apex controller,

but I can't figure out how to pass the value from javascript to Apex controller.

 

I have looked for other discussion bords no information found out:<

(this page can be simillar but no exaple on it http://community.salesforce.com/sforce/board/message?board.id=apex&thread.id=13138)

 

I really want to study this so please kindly advise me.....

 

thanks:smileysad:

hi all,

  

I just wanna ask you how call apex class from visualforce.

Acually, I am trying to do is like "math drill" (good for start-up programming ?) ,

 

it shows some questions in visualforce like,

 

3+4 =

5*4 =

12-3=

and when the button has been clicked, answers comes up.

 

 


But I have totally no idea how to call this class and show it in visualforce.

 

I am just a beginner, I just have start using force.com yesterday.

 

 

Thanks:smileysad:,