对于循环打印问题 [英] For Loop Print Issue

查看:81
本文介绍了对于循环打印问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我使用PRN文件用Zebra打印机打印条形码。

我从数据中获取值表格使用For LOOP。



我只得到数据表中的最后一行值。



当我使用断点调试代码时所有的行值都被打印出来。





有什么问题?如何解决?



问候,

Palraj M

Hi All,

I am using PRN file to print a barcode with Zebra Printer.
I am taking values from a Data table by using For LOOP.

I am getting only the LAST row Value in the data table.

When I Debug the Code with Break point All the Row values got printed.


What is the issue ? How to resolve?

Regards,
Palraj M

推荐答案

代码很难解决这个问题。

但是从你的问题陈述中,我理解了几点。

调试时你会得到所有的值但是在你写这篇文章时只会获得最后一个值。

在for循环中你循环使用值,但我猜你是在循环中写出值。

所以我的建议就是你一个全局列表<>宾语。在for循环中,您只需将元素添加到该List<>对象。

然后在for循环之外使用List<>打印对象。我猜,它会解决你的问题。
Without code it’s difficult to solve this issue.
But from your problem statement, I understand few points.
While debugging you will get all the values but at the time of writing you will get only last value.
Inside for loop you are looping the values, but I guess you are writing the values outside for loop.
So my suggestion in you will take one global List<> object. Inside for loop you just add element to that List<> object.
And then outside of for loop just use that List<> object for print. I guess, it will solve your problem.


这篇关于对于循环打印问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆