IMPRIMIR ARRAY

HMG en Español

Moderator: Rathinagiri

Post Reply
User avatar
SALINETAS24
Posts: 667
Joined: Tue Feb 27, 2018 3:06 am
DBs Used: DBF
Contact:

IMPRIMIR ARRAY

Post 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
Como dijo el gran pensador Hommer Simpson..., - En este mundo solo hay 3 tipos de personas, los que saben contar y los que no. :shock:
User avatar
serge_girard
Posts: 3161
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: IMPRIMIR ARRAY

Post by serge_girard »

Try LABEL &cSAY

Serge
There's nothing you can do that can't be done...
User avatar
mustafa
Posts: 1158
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Contact:

Re: IMPRIMIR ARRAY

Post 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:
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: IMPRIMIR ARRAY

Post by andyglezl »

Recuerdas esto ??
----------------------
Remember this ??

viewtopic.php?f=24&t=5569&p=54414#p54414
Andrés González López
Desde Guadalajara, Jalisco. México.
User avatar
SALINETAS24
Posts: 667
Joined: Tue Feb 27, 2018 3:06 am
DBs Used: DBF
Contact:

Re: IMPRIMIR ARRAY

Post 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
Como dijo el gran pensador Hommer Simpson..., - En este mundo solo hay 3 tipos de personas, los que saben contar y los que no. :shock:
Post Reply