Adalberto_sis Posted February 12, 2010 Report Share Posted February 12, 2010 Companheiros no clippão eu identificava o terminal assim: autoexec.nt SET MAQ=MAQ003 no sistema faço assim Terminal:=GETE("MAQ") no five se eu fizer assim o retorno de terminal é sempre nulo como extrair o valor de MAQ Obs: minhas dúvida consigo achar tudo pesquisando no forum, mais esta não estou conseguindo achar. Adalberto FWH 6.12 Quote Link to comment Share on other sites More sharing options...
Adalberto_sis Posted February 12, 2010 Author Report Share Posted February 12, 2010 Companheiros no clippão eu identificava o terminal assim: autoexec.nt SET MAQ=MAQ003 no sistema faço assim Terminal:=GETE("MAQ") no five se eu fizer assim o retorno de terminal é sempre nulo como extrair o valor de MAQ Obs: minhas dúvida consigo achar tudo pesquisando no forum, mais esta não estou conseguindo achar. Adalberto FWH 6.12 Quote Link to comment Share on other sites More sharing options...
netsys Posted February 12, 2010 Report Share Posted February 12, 2010 Ola Adalberto Tente assim: Terminal=GetEnv("MAQ") Alberto S.Paulo Quote Link to comment Share on other sites More sharing options...
kapiaba Posted February 12, 2010 Report Share Posted February 12, 2010 //-> Conecte a Rede assim Adaberto IF NETNAME() = "MAQ001" //-> Servidor //.... RETURN NIL ENDIF STATIC FUNCTION CONECTA_SERVIDOR() /*limpia arreglo y llama al colecor de basura de xharbour*/ hb_gcAll() WNetAddCon( "\\MAQ003\C",,"Z:" ) SysWait(1) RETURN NIL //-> Desconecta a Rede STATIC FUNCTION DESCONECTA_SERVIDOR() /*limpia arreglo y llama al colecor de basura de xharbour*/ hb_gcAll() wNetDelConnection( "Z:", .T. ) SysWait(1) RETURN NIL id=code>id=code>Abraços. João Santos - São Paulo. kmt_karinha@pop.com.br joao@pleno.com.br Fone: (11) 3106-2832 / 8243-5632 FWH 2.7 - xHARBOUR 0.99.61 - WorkShop.Exe Quote Link to comment Share on other sites More sharing options...
aferra Posted February 12, 2010 Report Share Posted February 12, 2010 e complementando use o autoexec.nt e o config.nt para configurar ou senão crie as variaveis de ambiente atraves do msconfig. Alessandroid=blue> FW20d+CL53b+Blk7+@Say+CDX FW9.07+xHb121+PellesC+CDX "Uma imaginação bem canalizada é fonte de grandes proezas"id=red> Quote Link to comment Share on other sites More sharing options...
MARSAN Posted February 16, 2010 Report Share Posted February 16, 2010 Se for fwh 32bits tem que criar as variaveis no windows. Painel de controle->sistema->avancado->variaveis de ambiente. fwh 9.03+xharbour,bcc55,xdev Quote Link to comment Share on other sites More sharing options...
Adalberto_sis Posted February 17, 2010 Author Report Share Posted February 17, 2010 Obrigado a todos pelas respotas, autoexec.nt realmente não funciona, mais usando variaveis de ambiente deu certo... Kapiaba estava pesquisando aqui o NETNAME() e ele pega o nome da maquina, achei interessante, mais a finalidade de momento, seria mais interessante o metodo antigo mesmo... Vlw Obrigado Adalberto Quote Link to comment Share on other sites More sharing options...
SHARK Posted February 18, 2010 Report Share Posted February 18, 2010 Eu tinha o mesmo problema. O windows teve muitas variações como 98, ME, 2000, XP e por este motivo resolvi abandonar a prática de criar variáveis de ambiente através do AUTOEXEC. Ao invés disto eu crio um arquivo INI na pasta do windows e dentro dele coloco minhas variáveis. Exemplo: arquivo C:\WINDOWS\MEUPROGRAMA.INI TERMINAL=003 DADOS=C:\MEUPROGRAMA\DADOS BACKUP=D:\BACKUP Assim sendo utilizo funções próprias para ler os valores e também alterá-los. Estas são as funções: *------------------------------------------------------* FUNCTION Pc_GetEnv( cFile, cEnviroment ) LOCAL cGetEnv, cText, nPos cText := MEMOREAD( cFile ) nPos := AT( cEnviroment + "=", cText ) IF nPos != 0 cText := SUBSTR( cText, nPos + LEN( cEnviroment ) + 1 ) IF AT( CHR(13), cText ) != 0 cText := SUBSTR( cText, 1, AT( CHR(13), cText ) - 1 ) ENDIF IF AT( CHR(10), cText ) != 0 cText := SUBSTR( cText, 1, AT( CHR(10), cText ) - 1 ) ENDIF cGetEnv := cText ENDIF RETURN( cGetEnv ) *--------------------------------------------------* FUNCTION Pc_SaveEnv( cFile, cEnviroment, cValue ) LOCAL cGetEnv, cText, nPos cText := MEMOREAD( cFile ) nPos := AT( cEnviroment + "=", cText ) IF nPos != 0 cText := STRTRAN( cText, cEnviroment + "=" + Pc_GetEnv( cFile, cEnviroment ) + CRLF, "" ) ENDIF IF RIGHT( cText, 1 ) != CHR(13) .AND. RIGHT( cText, 1 ) != CHR(10) cText += CRLF ENDIF cText := cText + cEnviroment + "=" + cValue + CRLF MEMOWRIT( cFile, cText ) RETURN NIL *----------------------------------------------------------* Para encontrar o seu arquivo na pasta do windows use a função GetWinDir() + "\MEUPROGRAMA.INI" Utilize as funções acima assim: Para ler... cFile := GetWinDir() + "\MEUPROGRAMA.INI" cTerminal := Pc_GetEnv( cFile, "TERMINAL" ) Para salvar... cFile := GetWinDir() + "\MEUPROGRAMA.INI" Pc_SaveEnv( cFile, "TERMINAL", "003" ) SharkAbraços! Shark - FWH 8.09 / xharbour 1.1.0 / xMate 1.15 / Resource WorkShop http://www.superdownloads.com.br/download/41/programa-de-auto-escola-automax/ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.