Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Concatenating FStrings

I am baffled by the FString::Format method. My desired goal is to concatenate three float values into an FString (separated by commas). Example: from 0.5f, 1.5f and 76.1f create "0.5,1.5,76.1".

For some reason concatenating FString is not allowed (FString::SanitizeFloat(0.5f) + FString(",") doesn't work) and I was unable to make the FString::Format method work (FString::Format(&FString("{0},"), 1.5f) throws bad arguments error).

I am aware of the Append function, but that seems very unoptimized when concatenating for example 5 strings.

Product Version: UE 4.11
more ▼

asked Jun 21 '16 at 07:51 AM in C++ Programming

avatar image

10 5 7 7

avatar image NymKappa Jun 21 '16 at 08:50 AM

I just tested FString Toto = FString::SanitizeFloat(0.5f) + FString("321"); and it compiles.

avatar image ViliX64 Jun 21 '16 at 08:53 AM

What version are you currently using? Your snippet throws me the same compile time error as the first method that I've tried.

 c:\program files (x86)\epic games\4.11\engine\source\runtime\core\public\Misc/OutputDevice.h(382): error C2665: 'CheckVA': none of the 11 overloads could convert all the argument types
avatar image NymKappa Jun 21 '16 at 09:12 AM

I'm using 4.12.

I just google this CheckVA weird thing. I suggest you look at this post https://answers.unrealengine.com/questions/41839/checkva-none-of-the-11-overloads-could-convert-all.html

avatar image ViliX64 Jun 21 '16 at 09:22 AM

Uh. That suggests the issue may be somewhere else, but that is rather odd considering that the game compiles when FString concatenations are removed. Thanks for your effort, though.

avatar image NymKappa Jun 21 '16 at 09:24 AM

Are you using Visual Studio 2015 by the way ? Cause the post talks about C++11 which is not supported in old visual studio version.

avatar image ViliX64 Jun 21 '16 at 09:58 AM

Switching to newer VS solved the issue, but that is strange since VS doesn't have anything to do with the build process (only invokes UE programs that do the actuall build).

avatar image NymKappa Jun 21 '16 at 10:01 AM

I don't think Epic Games actually re-developped their own C++ compiler. I think they use the Visual Studio one.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question