IMPRIMIR ARRAY

HMG en Español

Moderator: Rathinagiri

Post Reply
User avatar
SALINETAS24
Posts: 173
Joined: Tue Feb 27, 2018 3:06 am
DBs Used: DBF
Has thanked: 2 times
Been thanked: 3 times

IMPRIMIR ARRAY

Post by SALINETAS24 » Sat Apr 21, 2018 9:49 am

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

User avatar
serge_girard
Posts: 2120
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Has thanked: 437 times
Been thanked: 95 times
Contact:

Post by serge_girard » Sat Apr 21, 2018 10:06 am

Try LABEL &cSAY

Serge

User avatar
mustafa
Posts: 690
Joined: Fri Mar 20, 2009 11:38 am
Location: Alicante - Spain
Been thanked: 78 times

Post by mustafa » Sat Apr 21, 2018 11:14 am

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: 987
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Has thanked: 20 times
Been thanked: 41 times
Contact:

Post by andyglezl » Sat Apr 21, 2018 2:34 pm

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: 173
Joined: Tue Feb 27, 2018 3:06 am
DBs Used: DBF
Has thanked: 2 times
Been thanked: 3 times

Post by SALINETAS24 » Sat Apr 21, 2018 8:45 pm

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

Post Reply