Post Reply 
Input Question
11-17-2017, 11:59 AM (This post was last modified: 11-17-2017 12:00 PM by Didier Lachieze.)
Post: #8
RE: Input Question
I take a look at your program and if I don't understand all you want to do I noticed that you have a recursive call to erfAs as well as a call to Startview(-1) which I don't think are necessary.
So I modified a little bit your code to follow the sequence:

Main Loop:
-Input form to get variable values
-Calculation and display of result
-Wait until user press a soft key
Exit loop if soft key is "ENDE" or "weiter", else loop

If soft key is Weiter, do what you need for Weiter
If soft key is ENDE, do what you need for ENDE

Code:

EXPORT erfAs()

BEGIN

  LOCAL Md,H1,b,∅Bew,∅Büg,d,as;
  LOCAL cnom;
  LOCAL m,m1,mx,my;
  LOCAL Ende, Weiter, Zurück;

  //Main loop
  REPEAT

    INPUT({{Md,[0],{25,15,0}},
    {H1,[0],{25,15,1}},
    {b,[0],{25,15,2}},
    {cnom,[0],{72,15,0}},
    {∅Büg,[0],{72,15,1}},
    {∅Bew,[0],{72,15,2}}},
    "Beton-Querkraftwiderstand",
    {"Md [kNm]","h [mm] ","b [mm] ","cnom [mm] ","∅Büg [mm]","∅Bew [mm]"},
    {"Bemessungsmoment","Höhe des Betonquerschnittes","breite des Betonquerschnittes","Betondeckung [mm]","Bügeldurchmesser [mm]","Bewehrungsdurchmesser [mm]"});

    d:=H1-cnom-∅Büg-∅Bew;
    as:=Md*1000000/(0.9*d*435);

    RECT_P(7,135,310,200,RGB(0,0,0),RGB(0,230,255));
  
    TEXTOUT_P("Ergebniss: ",19,140,6);
    //LINE_P(0,185,170,185);

    TEXTOUT_P("erf As",120,140,6);
    TEXTOUT_P("=",180,140,6);
    TEXTOUT_P(ROUND(as,0)+" mm²",195,140,6);
    //TEXTOUT_P("mm",240,140,6);


    DRAWMENU("ENDE","","weiter","","","zurück");

    REPEAT
      // Get mouse data
      REPEAT
        m:=MOUSE; m1:=m(1);
      UNTIL SIZE(m1)>0;
      mx:=m1(1); my:=m1(2);
      Ende:=(my≥220 AND my≤319) AND (mx≥0 AND mx≤51);
      Weiter:=(my≥220 AND my≤319) AND (mx≥106 AND mx≤160);
      Zurück:=(my≥220 AND my≤319) AND (mx≥265 AND mx≤319);
    UNTIL (Ende or Weiter or Zurück); // wait for a soft key

  UNTIL (Ende or Weiter); // exit Main loop with "ENDE" or "weiter"

  // weiter
  IF Weiter THEN
    //do what you need for weiter
  END;

  // ENDE
  IF Ende THEN
    //do what you need for ENDE
  END;

END;
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Input Question - Onieh - 11-17-2017, 09:16 AM
RE: Input Question - webmasterpdx - 11-17-2017, 09:24 AM
RE: Input Question - Onieh - 11-17-2017, 09:41 AM
RE: Input Question - webmasterpdx - 11-17-2017, 10:23 AM
RE: Input Question - Onieh - 11-17-2017, 11:01 AM
RE: Input Question - webmasterpdx - 11-17-2017, 11:11 AM
RE: Input Question - Onieh - 11-17-2017, 11:29 AM
RE: Input Question - Didier Lachieze - 11-17-2017 11:59 AM
RE: Input Question - webmasterpdx - 11-17-2017, 12:00 PM
RE: Input Question - webmasterpdx - 11-17-2017, 12:06 PM
RE: Input Question - webmasterpdx - 11-17-2017, 12:10 PM
RE: Input Question - Onieh - 11-17-2017, 12:37 PM



User(s) browsing this thread: 1 Guest(s)