Page 1 of 1

IMPRIMIR ARRAY

Posted: Sat Apr 21, 2018 9:49 am
by SALINETAS24
Hola, quiero mostrar un array en pantalla, lo que en clipper seria

FOR N=1 TO 10
@ N+1,10 SAY STR(N)
NEXT

He probado con esto, he quitado también el &, pero nada

FOR nCol=1 TO 15

cSay="SAY_"+str(nCol,1)
@ 36+(30*nCol) , 405 LABEL "&cSAY" ;
VALUE "toma" WIDTH 5

NEXT

gracias

Re: IMPRIMIR ARRAY

Posted: Sat Apr 21, 2018 10:06 am
by serge_girard
Try LABEL &cSAY

Serge

Re: IMPRIMIR ARRAY

Posted: Sat Apr 21, 2018 11:14 am
by mustafa
OK !!! Serge

Code: Select all


#include "hmg.ch"

FUNCTION MAIN() 
PRIVATE nCol, cSay

  DEFINE WINDOW Main                  ;
      AT 0,0                          ;
      WIDTH 550  HEIGHT 420           ; 
      BACKCOLOR  { 255,255,093 }      ;         
      MAIN         
      ON KEY ESCAPE ACTION  Main.Release  
   
FOR nCol=1 TO 15   
cSay="SAY_"+ ALLTRIM((STR(nCol)))                  
 @ 09+(21*nCol) , 250  LABEL &cSay  VALUE " toma " WIDTH 50 ;
   FONT "Arial" SIZE 10 BOLD ITALIC BACKCOLOR  { 020,086,020 }  
NEXT

MsgInfo( cSay)

END WINDOW
 
  Center Window Main
  Activate Window Main

Return Nil

Regards
Mustafa :idea:

Re: IMPRIMIR ARRAY

Posted: Sat Apr 21, 2018 2:34 pm
by andyglezl
Recuerdas esto ??
----------------------
Remember this ??

viewtopic.php?f=24&t=5569&p=54414#p54414

Re: IMPRIMIR ARRAY

Posted: Sat Apr 21, 2018 8:45 pm
by SALINETAS24
Muchas gracias a todos.
Hay días en los que uno no tendría que programar. Esa sería la mejor solución y no ir molestando. Lo siento por mi torpeza y gracias por vuestra paciencia. Mi curva de aprendizaje está siendo lenta.

--- y según GOOGLE he dicho esto en Inglés.

Thank you very much to all.
There are days when you do not have to program. That would be the best solution and not go bothering. I'm sorry for my clumsiness and thank you for your patience. My learning curve is slow

Code: Select all

	LOCAL aHoras:={"07","08","09","10","11","12","13","14","15","16","17","18","19","20","21"}
	FOR nCol=1 TO 15
		cSay="SAY_"+cStrZero(nCol,2)
		cVar=aHoras[nCol]
		 @ 36+(30*nCol) ,300 LABEL &cSAY ;
				VALUE &cVar  
	NEXT