Tempo de leitura: 3 minutos
Olá, no post de hoje iremos falar da função ReadVar em ADVPL. A finalidade dessa função é fornecer o nome do campo(ex:M->D1_DOC) ou variável(cCPF) de onde estamos digitando algum valor. Ela muito útil para fazermos validações baseada no campo que estamos digitando. Ela também é uma das funções de Interface Visual em ADVPL.
Podemos usar a função ReadVar em conjunto com o operador macro & para obter o conteúdo do campo ou variável a qual ReadVar referencia. Ex. &(ReadVar).
Sintaxe:
ReadVar()
Parâmetro(s):
——-
Retorno:
Exemplo da função ReadVar em ADVPL para obtermos o nome da variável de um objeto do tipo Get:
#include 'protheus.ch'
#include 'totvs.ch'
/*{Protheus.doc} User Function fReadVar
(Essa função tem por finalidade mostrar a função ReadVar em ADVPL)
@type Function
@author Adilio Costa
@since 24/04/2024
@version Protheus 12.1.2210
@Inscreva-se no Blog ProtheusAdvpl:
https://www.protheusadvpl.com.br
@Inscreva-se no Canal ProtheusAdvpl:
https://www.youtube.com/protheusadvpl
@Siga-nos no Instagram:
https://www.instagram.com/protheusadvpl
@Conheça os Cursos do ProtheusAdvpl:
https://hotmart.com/pt-br/club/protheusadvpl
|Se esse conteúdo foi útil pra você nos ajude divulgando
ele e nossas redes sociais!!|
*/
User Function fReadVar()
@ 010,050 MSGET cCPF SIZE 55,11 OF oDlg PIXEL PICTURE "@R 999.999.999-99";
VALID U_Valida()
@ 050,050 MSGET cCNPJ SIZE 55,11 OF oDlg PIXEL PICTURE "@R 99.999.999/9999-99";
VALID U_Valida()
Return
User Function Valida()
Local cCampo
Local cConteudo
Local lValid := .F.
//Obtendo o nome variável
cCampo := ReadVar()
//Otendo o conteúdo da variável
cConteudo := &(ReadVar())
If(cCampo == "cCPF")
MsgInfo("Você digitou o CPF:"+cConteudo,"Função ReadVar")
lValid := ValCPF(cConteudo)
ElseIf(cCampo == "cCNPJ")
MsgInfo("Você digitou o CNPJ:"+cConteudo,"Função ReadVar")
Else
MsgInfo("Campo inválido!","Função ReadVar")
lValid := ValCNPJ(cConteudo)
EndIf
Return lValid
Exemplo da função ReadVar em ADVPL para obtermos o nome do campo na tela do documento de entrada(MATA103):
#include 'protheus.ch'
#include 'totvs.ch'
/*{Protheus.doc} User Function fReadVar
(Essa função tem por finalidade mostrar a função ReadVar em ADVPL)
@type Function
@author Adilio Costa
@since 24/04/2024
@version Protheus 12.1.2210
@Inscreva-se no Blog ProtheusAdvpl:
https://www.protheusadvpl.com.br
@Inscreva-se no Canal ProtheusAdvpl:
https://www.youtube.com/protheusadvpl
@Siga-nos no Instagram:
https://www.instagram.com/protheusadvpl
@Conheça os Cursos do ProtheusAdvpl:
https://hotmart.com/pt-br/club/protheusadvpl
|Se esse conteúdo foi útil pra você nos ajude divulgando
ele e nossas redes sociais!!|
*/
User Function VerCampo()
Local cCampoSD1 := ""
Local cContSD1 := ""
//Obtém o nome do campo da tabela SD1 a qual está sendo digitado
cCampoSD1 := ReadVar()
//Obtém o conteúdo do campo da tabela SD1 que foi digitado
cContSD1 := &(ReadVar())
If(cCampoSD1 == "M->D1_DOC")
MsgInfo("Você digitou o documento:"+cContSD1)
ElseIf(cCampoSD1 == "M->D1_SERIE")
MsgInfo("Você digitou a série:"+cContSD1)
ElseIf(cCampoSD1 == "M->D1_TES")
MsgInfo("Você digitou a TES:"+cContSD1)
Else
MsgInfo("Você digitou outro campo de conteúdo:"+cContSD1)
EndIf
Return
É isso aí, finalizamos aqui mais um post no Blog ProtheusAdvpl. Caso tenha ficado alguma dúvida deixe seu comentário ou nos envie um e-mail para adiliocosta@protheusadvpl.com.br, até um próximo post, grande abraço e fica com Deus.
Link(s) de referência(s):
Link permanente
My brother suggested I might like this website He was totally right This post actually made my day You cannt imagine just how much time I had spent for this information Thanks
Link permanente
My brother suggested I might like this website He was totally right This post actually made my day You cannt imagine just how much time I had spent for this information Thanks
Link permanente
I have been surfing online more than 3 hours today yet I never found any interesting article like yours It is pretty worth enough for me In my opinion if all web owners and bloggers made good content as you did the web will be much more useful than ever before
Link permanente
I have been surfing online more than 3 hours today yet I never found any interesting article like yours It is pretty worth enough for me In my opinion if all web owners and bloggers made good content as you did the web will be much more useful than ever before
Link permanente
Simply desire to say your article is as surprising The clearness in your post is simply excellent and i could assume you are an expert on this subject Fine with your permission let me to grab your feed to keep up to date with forthcoming post Thanks a million and please carry on the gratifying work
Link permanente
I loved as much as you will receive carried out right here The sketch is attractive your authored material stylish nonetheless you command get got an impatience over that you wish be delivering the following unwell unquestionably come more formerly again since exactly the same nearly a lot often inside case you shield this hike
Link permanente
Hi my loved one I wish to say that this post is amazing nice written and include approximately all vital infos Id like to peer more posts like this
Link permanente
Your blog is a treasure trove of valuable insights and thought-provoking commentary. Your dedication to your craft is evident in every word you write. Keep up the fantastic work!
Link permanente
I have been browsing online more than three hours today yet I never found any interesting article like yours It is pretty worth enough for me In my view if all website owners and bloggers made good content as you did the internet will be a lot more useful than ever before
Link permanente
I do not even know how I ended up here but I thought this post was great I dont know who you are but definitely youre going to a famous blogger if you arent already Cheers
Link permanente
Your blog is a beacon of light in the often murky waters of online content. Your thoughtful analysis and insightful commentary never fail to leave a lasting impression. Keep up the amazing work!
Link permanente
I was suggested this web site by my cousin Im not sure whether this post is written by him as no one else know such detailed about my trouble You are incredible Thanks
Link permanente
먹튀검증 커뮤니티에 참여하여 안전한 온라인 놀이터 정보를 공유하고 받아보세요! 다른 사용자들의 경험과 후기를 통해 사기 피해를 예방하고 안전하게 게임을 즐길 수 있습니다.
Link permanente
Thanks I have recently been looking for info about this subject for a while and yours is the greatest I have discovered so far However what in regards to the bottom line Are you certain in regards to the supply
Link permanente
먹튀검증커뮤니티에 참여하여 안전한 온라인 놀이터 정보를 공유하고 받아보세요! 다른 사용자들의 경험과 후기를 통해 사기 피해를 예방하고 안전하게 게임을 즐길 수 있습니다.
Link permanente
https://beyoglueskort.net/beyogludaki-en-populer-escort-bayanlar
Link permanente
Maxwin500 adalah link alternatif main game slot online terpopuler dengan fitur paling lengkap yang gampang menang maxwin hari ini 2024.
Link permanente
Maxwin500 adalah link alternatif main game slot online terpopuler dengan fitur paling lengkap yang gampang menang maxwin hari ini 2024.
Link permanente
Maxwin500 adalah link alternatif main game slot online terpopuler dengan fitur paling lengkap yang gampang menang maxwin hari ini 2024.
Link permanente
Maxwin500 adalah link alternatif main game slot online terpopuler dengan fitur paling lengkap yang gampang menang maxwin hari ini 2024.
Link permanente
[토토사이트 추천] 함께 나누는 온라인 안전 놀이터 정보!
Link permanente
Your blog is a testament to your expertise and dedication to your craft. I’m constantly impressed by the depth of your knowledge and the clarity of your explanations. Keep up the amazing work!
Link permanente
Your writing is like a breath of fresh air in the often stale world of online content. Your unique perspective and engaging style set you apart from the crowd. Thank you for sharing your talents with us.
Link permanente
Your passion for your subject matter shines through in every post. It’s clear that you genuinely care about sharing knowledge and making a positive impact on your readers. Kudos to you!
Link permanente
you are in reality a just right webmaster The site loading velocity is incredible It seems that you are doing any unique trick In addition The contents are masterwork you have performed a wonderful task on this topic
Link permanente
[토토사이트] 카지노커뮤니티 이용으로 먹튀검증 및 토토사이트 먹튀를 예방하세요.
Link permanente
I’ve learned so much from reading your blog. Thank you for sharing your knowledge with the world.
Link permanente
I’ve learned so much from reading your blog. Thank you for sharing your knowledge with the world.
Link permanente
I always look forward to your new posts. They never disappoint. Keep up the fantastic work!
Link permanente
Wow, I had no idea about this. Your blog always teaches me something new. Keep up the good work!
Link permanente
Your blog is like a breath of fresh air in a sea of mediocre content. Thank you for keeping it real!
Link permanente
I wish more blogs were as informative and well-written as yours. It’s a pleasure to read.
Link permanente
Wow, I had no idea about this. Your blog always teaches me something new. Keep up the good work!
Link permanente
I’ve shared your blog with all my friends. That’s how much I believe in the value of your content.
Link permanente
I love how you incorporate personal anecdotes into your posts. It makes them feel more relatable.
Link permanente
Your writing style is so engaging. I couldn’t stop reading until I finished the whole post. Well done!
Link permanente
I wish more blogs were as informative and well-written as yours. It’s a pleasure to read.
Link permanente
Your blog has become my go-to resource whenever I need information on [topic]. Keep up the excellent work!
Link permanente
This is exactly what I needed to read today. It’s like you wrote this just for me. Thank you!
Link permanente
Your writing style is so engaging. I couldn’t stop reading until I finished the whole post. Well done!
Link permanente
You have a real talent for explaining complex topics in a way that’s easy to understand. Kudos!
Link permanente
I’ve learned so much from reading your blog. Thank you for sharing your knowledge with the world.
Link permanente
Great post! I never thought about it that way before. You’ve given me a new perspective.
Link permanente
I’m bookmarking this post for future reference. It’s a treasure trove of valuable information. Thank you!
Link permanente
Your passion for this subject really shines through in your writing. It’s inspiring to see. Keep it up!
Link permanente
Your passion for this subject really shines through in your writing. It’s inspiring to see. Keep it up!
Link permanente
helloI like your writing very so much proportion we keep up a correspondence extra approximately your post on AOL I need an expert in this space to unravel my problem May be that is you Taking a look forward to see you
Link permanente
Thank you for the auspicious writeup It in fact was a amusement account it Look advanced to far added agreeable from you However how can we communicate
Link permanente
“The depth of analysis in this blog post is impressive. It’s refreshing to find a resource that not only educates but also inspires action. The clear writing style and thoughtful explanations make complex concepts accessible. Keep up the great work!”
Link permanente
[먹튀검증사이트] 카지노커뮤니티 이용으로 먹튀검증 및 토토사이트 먹튀를 예방하세요.
Link permanente
Thank you immensely for the wealth of knowledge you’ve provided on your platform. Your content has been instrumental in expanding my understanding, and I’m eager to continue exploring all that your site has to offer.
Link permanente
Thank you immensely for the wealth of knowledge you’ve provided on your platform. Your content has been instrumental in expanding my understanding, and I’m eager to continue exploring all that your site has to offer.
Link permanente
Thank you immensely for the wealth of knowledge you’ve provided on your platform. Your content has been instrumental in expanding my understanding, and I’m eager to continue exploring all that your site has to offer.
Link permanente
Thank you immensely for the wealth of knowledge you’ve provided on your platform. Your content has been instrumental in expanding my understanding, and I’m eager to continue exploring all that your site has to offer.
Link permanente
Thank you immensely for the wealth of knowledge you’ve provided on your platform. Your content has been instrumental in expanding my understanding, and I’m eager to continue exploring all that your site has to offer.
Link permanente
Thank you for providing such valuable information on your site. I found it incredibly useful and will definitely be returning for more.
Link permanente
“Thank you for addressing such an important topic with clarity and authority. The information shared here is timely and relevant, and I appreciate the effort put into providing actionable advice. Looking forward to reading more from this blog!”
Link permanente
Your dedication to providing enriching content hasn’t gone unnoticed. I’m continually impressed by the depth and breadth of information available on your platform. Thank you for being a reliable source of enlightenment!
Link permanente
I can’t thank you enough for the wealth of knowledge you’ve provided on your platform. Your content has been instrumental in broadening my horizons, and I’m excited to see what more I can learn from your resources. Here’s to continued growth and learning!
Link permanente
I wanted to take a moment to express my gratitude for the incredible work you’re doing. Your platform has become an invaluable resource for me, and I’m constantly amazed by the breadth of topics covered. Thank you for being a guiding light in the pursuit of knowledge!
Link permanente
Thank you for being a beacon of knowledge and inspiration in the digital landscape. Your platform has become my go-to resource for learning, and I’m continually impressed by the caliber of content you deliver. Keep up the excellent work!
Link permanente
Thank you for being a beacon of knowledge in a sea of information. Your platform stands out for its quality content and user-friendly interface. I’m grateful for the opportunity to learn from such a reputable source!
Link permanente
Your platform has exceeded my expectations in every way possible. The depth of insights available is truly impressive, and I’m thankful for the opportunity to learn from such a reputable source. Here’s to many more enlightening discoveries!
Link permanente
Your website has become my go-to resource for insightful content. Thank you for consistently delivering valuable information that helps me grow. I’ll definitely be back for more!
Link permanente
Thank you for being a beacon of knowledge in a sea of information. Your platform stands out for its quality content and user-friendly interface. I’m grateful for the opportunity to learn from such a reputable source!
Link permanente
Thank you for being a constant source of inspiration and knowledge. Your platform has become my go-to destination for expanding my understanding of various subjects, and I’m grateful for the impact it’s had on my life. Keep up the fantastic work!
Link permanente
Your platform has exceeded my expectations in every way possible. The depth of insights available is truly impressive, and I’m thankful for the opportunity to learn from such a reputable source. Here’s to many more enlightening discoveries!
Link permanente
Your platform has exceeded my expectations in every way possible. The depth of insights available is truly impressive, and I’m thankful for the opportunity to learn from such a reputable source. Here’s to many more enlightening discoveries!
Link permanente
In addition, I found your article to be very well-researched and substantiated. The data and case studies you provided lend credibility to your arguments and demonstrate the potential for success when targeting the right niche. Thank you for putting so much thought and effort into creating this comprehensive resource.
Link permanente
In addition, I found your article to be very well-researched and substantiated. The data and case studies you provided lend credibility to your arguments and demonstrate the potential for success when targeting the right niche. Thank you for putting so much thought and effort into creating this comprehensive resource.
Link permanente
“The depth of analysis in this blog post is impressive. It’s refreshing to find a resource that not only educates but also inspires action. The clear writing style and thoughtful explanations make complex concepts accessible. Keep up the great work!”
Link permanente
I appreciate how the article encourages readers to take action based on the information presented.
Link permanente
The author’s insights into the nuances of the subject are eye-opening.